// Fields. // Constructor. public HUD(Game1 game, Texture2D texture, Cursor cursor, Sprite sprite) { this.texture = texture; this.cursor = cursor; this.game = game; this.sprite = sprite; InitComponent(); }
// Constructor. public GameMain(Game1 game, int sizeX, int sizeY) { this.game = game; selection = new SelectionTile(Ressources.SelectionTest); mapBackground = new Map(Ressources.tileSetFloorInt, this.cursor, this.selection, 6, 0, map1); mapMiddleground = new Map(Ressources.tileSetInterieur, this.cursor, this.selection, 5, 4, map2); cursor = new Cursor(32, 32, 2); sprite = new Sprite(new Vector2(875, 30), 5, 4, 6 ,0, 0 ,0); hud = new HUD(this.game, Ressources.textureHUD, this.cursor, this.sprite); }
// Constructor. public Map(Texture2D tileSet, Cursor CurrentCursor, SelectionTile currentSelection, int tileSetX, int tileSetY, int[,] mapTab) { this.cursor = CurrentCursor; this.tileSet = tileSet; this.tileSetX = tileSetX; this.tileSetY = tileSetY; this.mapTab = mapTab; this.mapChanged = true; this.selection = currentSelection; }
// Constructor. public Button(Game1 game, Cursor cursor, Texture2D texture, Vector2 position, string function, string title) { this.game = game; this.texture = texture; this.cursor = cursor; this.hitbox = new Rectangle((int)position.X, (int)position.Y, texture.Width, texture.Height); this.title = title; this.colorTitle = Color.Black; this.colorAlpha = Color.White; this.function = function; this.backState = BackButtonState.Released; /* Collsions */ this.textureData = new Color[this.texture.Width * this.texture.Height]; this.texture.GetData(this.textureData); }