Exemplo n.º 1
0
 public cCollider(Rectangle r, StateMachine.iState parent)
 {
     parentState = parent;
     rect        = r;
     Managers.CollisionManager.addCollider(this);
     Managers.CollisionManager.moveCollider(this);
     component = false;
 }
Exemplo n.º 2
0
 public cCollider(renderable r)
 {
     Managers.CollisionManager.addCollider(this);
     rRef        = r;
     parentState = r.parentState;
     rect        = new Rectangle((int)rRef.pos.xPos, (int)rRef.pos.yPos, rRef.getWidth(), rRef.getHeight());
     component   = true;
 }
Exemplo n.º 3
0
 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);
 }
Exemplo n.º 4
0
 //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);
 }
Exemplo n.º 5
0
 public Button(string text, Texture2D background, Action onClick, MouseButton buttonToCheck, StateMachine.iState state)
 {
     this.background = new quad(background, state);
     this.background.doDistCulling = false;
     t = new text(text, state);
     this.background.width  = t.tex.width;
     this.background.height = t.tex.height;
     this.onClick           = onClick;
     button = buttonToCheck;
     Game.buttonMan.Add(this);
     containingState = state;
 }
Exemplo n.º 6
0
 //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);
 }
Exemplo n.º 7
0
        public Button(int size, string text, Texture2D background, String toEcho, MouseButton buttonToCheck, StateMachine.iState state)
        {
            this.background = new quad(background, state);
            this.background.doDistCulling = false;
            t = new text(text, state);
            this.background.width  = size;
            this.background.height = size;

            this.echo = toEcho;
            onClick   = Echo;
            button    = buttonToCheck;
            Game.buttonMan.Add(this);
            containingState = state;
        }
Exemplo n.º 8
0
        //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);
        }