Example #1
0
 public Sprite(Game game, Texture2D tileSheet, SpriteBatch Batch, Vector2 pos, MapLoader.TileType t, bool dynamicObject = false)
     : base(game)
 {
     Position = pos;
     Tile = t;
     spriteBatch = Batch;
     TileSheet = tileSheet;
     theGame = (Game1)game;
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RenderTarget2DSample.AnimatedSprite"/> class.
        /// </summary>
        /// <param name='game'>
        /// Game.
        /// </param>
        /// <param name='tileSheet'>
        /// Tile sheet.
        /// </param>
        /// <param name='Batch'>
        /// Batch.
        /// </param>
        /// <param name='pos'>
        /// Position on screen
        /// </param>
        /// <param name='t'>
        /// T.
        /// </param>
        public AnimatedSprite(Game game, Texture2D tileSheet, SpriteBatch Batch, Vector2 pos, MapLoader.TileType t)
            : base(game, tileSheet, Batch, pos, t, false)
        {
            // As diff animated tiles have diff heights, get the offset from the top of the animated Tileset file
            if (t == MapLoader.TileType.NPC_ground)
                yOffset = 128;
            if (t == MapLoader.TileType.NPC_Flyer)
                yOffset = 160;

            lastFrameTime = System.Environment.TickCount;
            stopAnimation = false;
        }
Example #3
0
 public GlassesSprite(Game game, Texture2D tileSheet, Texture2D backgroundHighlight, SpriteBatch Batch, Vector2 pos, MapLoader.TileType t, GlassesUI.Glasses glassesType = GlassesUI.Glasses.Light)
     : base(game, tileSheet, Batch, pos, t, false)
 {
     glasses = glassesType;
         background = backgroundHighlight;
 }