source: 2014/30/MikkoI/WindowsGame1/WindowsGame1/WindowsGame1/Render/MapRenderer.cs @ 5558

Revision 5558, 1006 bytes checked in by mijoilmo, 5 years ago (diff)

a

Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using Microsoft.Xna.Framework;
5using Microsoft.Xna.Framework.Content;
6using Microsoft.Xna.Framework.Graphics;
7
8namespace 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.