コード例 #1
0
        public Icon(string iconFileName, int x, int y, int w, int h) : base()
        {
            var tex = IoManager.LoadTexture(iconFileName);

            this.sprite             = new Sprite(tex);
            this.sprite.TextureRect = new IntRect(x, y, w, h);
            this.size = new Vector2f(w, h);
        }
コード例 #2
0
        public Icon(string iconFileName, IntRect sprite) : base()
        {
            var tex = IoManager.LoadTexture(iconFileName);

            this.sprite             = new Sprite(tex);
            this.sprite.TextureRect = sprite;
            this.size = new Vector2f(sprite.Width, sprite.Height);
        }
コード例 #3
0
 public void SetTilemask(int gridWidth, int gridHeight, int cellWidth, int cellHeight, string texture)
 {
     this.refCellSize.X = cellWidth;
     this.refCellSize.Y = cellHeight;
     this.cellSize.X    = (int)(cellWidth * this.TileScale);
     this.cellSize.Y    = (int)(cellHeight * this.TileScale);
     this.GridWidth     = gridWidth;
     this.GridHeight    = gridHeight;
     maskMap            = new _Tile[gridHeight, gridWidth];
     this.tileset       = IoManager.LoadTexture(texture);
     this.AdjustLayer();
 }
コード例 #4
0
 override public void SetBackground(string texture)
 {
     if (texture == "")
     {
         this.DrawBackground = false;
         this.bgSprite       = new Sprite();
     }
     else
     {
         this.bgTexture      = IoManager.LoadTexture(texture, true);
         this.bgSprite       = new Sprite(this.bgTexture);
         this.DrawBackground = true;
         this.AdjustLayer();
     }
 }
コード例 #5
0
 public void SetLightTexture(string texture, int u, int v, int w, int h)
 {
     this.lightTexture = IoManager.LoadTexture(texture);
     //TODO
 }
コード例 #6
0
 /// <summary>
 /// Sets the background.
 /// </summary>
 /// <param name="texture">The file name of the texture.</param>
 virtual public void SetBackground(string texture)
 {
     this.bgTexture = IoManager.LoadTexture(texture, true);
     this.bgSprite  = new Sprite(this.bgTexture);
     this.AdjustLayer();
 }