Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using Microsoft.Xna.Framework; |
---|
5 | using Microsoft.Xna.Framework.Content; |
---|
6 | using Microsoft.Xna.Framework.Graphics; |
---|
7 | |
---|
8 | namespace WindowsGame1 |
---|
9 | { |
---|
10 | class MapRenderer |
---|
11 | { |
---|
12 | SpriteBatch spriteBatch; |
---|
13 | public MapRenderer(SpriteBatch spriteBatch) { |
---|
14 | this.spriteBatch = spriteBatch; |
---|
15 | } |
---|
16 | public void renderGroundTile(Texture2D texture, int x, int y){//renderöi maata |
---|
17 | spriteBatch.Draw(texture, new Rectangle(x * texture.Width, y * texture.Height, texture.Width, texture.Height), null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0f); |
---|
18 | } |
---|
19 | public void renderGroundObject(Texture2D texture, int x, int y, Vector2 size) {//renderöi maassa olevan asian (ei liiku) |
---|
20 | spriteBatch.Draw(texture, new Rectangle(x * texture.Width, y * texture.Height, (int)size.X, (int)size.Y), null, Color.Red, 0, Vector2.Zero, SpriteEffects.None, 0f); |
---|
21 | } |
---|
22 | } |
---|
23 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.