//Construct with single texture file public quad(string textureLocation, StateMachine.iState parent) { parentState = parent; pos = new transform(); components = new List <iComponent>(); tex = Managers.TextureManager.LoadTexture(textureLocation, false); height = tex.height; width = tex.width; parent.addUpdater(update); }
public quad(Texture2D texture, StateMachine.iState parent) { parentState = parent; pos = new transform(); components = new List <iComponent>(); tex = texture; height = tex.height; width = tex.width; parent.addUpdater(update); }
//Construct with texture atlas and Texture ID public quad(TextureAtlas tAtlas, int id, StateMachine.iState parent) { parentState = parent; pos = new transform(); components = new List <iComponent>(); atlas = tAtlas; texID = id; tex = tAtlas.getTile(id); height = tAtlas.tilePixelHeight; width = tAtlas.tilePixelWidth; parent.addUpdater(update); }
//construct a text entity based off of a letter array public text(Letter[] letters, StateMachine.iState parent) { parentState = parent; tiles = new Tile[letters.Length]; pos = new transform(); components = new List <iComponent>(); //create the tile array for (int i = 0; i < letters.Length; i++) { tiles[i] = new Tile(); tiles[i].TexID = (int)letters[i]; tiles[i].tAtlas = Game.font; } //generate the texture based off of the tile array tex = Managers.TextureManager.TextureFrom1DTileMap(tiles); textString = ""; parent.addUpdater(update); }