Ejemplo n.º 1
0
 public void Draw(SpriteBatch spriteBatch, Loc pos, ulong totalTick, Color color)
 {
     if (Frames.Count > 0)
     {
         int       currentFrame = (int)(totalTick / (ulong)FrameTick.FrameToTick(FrameLength) % (ulong)Frames.Count);
         TileFrame frame        = Frames[currentFrame];
         if (frame != TileFrame.Empty)
         {
             BaseSheet texture = GraphicsManager.GetTile(frame);
             texture.Draw(spriteBatch, pos.ToVector2(), null, color);
         }
     }
 }
Ejemplo n.º 2
0
 public override string ToString()
 {
     if (AutoTileset > -1 && AutoTileset < DataManager.Instance.DataIndices[DataManager.DataType.AutoTile].Entries.Count)
     {
         return(String.Format("AutoTile {0}", DataManager.Instance.DataIndices[DataManager.DataType.AutoTile].Entries[AutoTileset].Name.ToLocal()));
     }
     else
     {
         if (Layers.Count > 0)
         {
             TileLayer layer = Layers[0];
             if (layer.Frames.Count > 0)
             {
                 TileFrame frame = layer.Frames[0];
                 return(String.Format("AutoTile {0}: {1}", frame.Sheet, frame.TexLoc.ToString()));
             }
         }
     }
     return("[EMPTY]");
 }
Ejemplo n.º 3
0
 public bool Equals(TileFrame other)
 {
     return(TexLoc == other.TexLoc && Sheet == other.Sheet);
 }
Ejemplo n.º 4
0
 public TileLayer(TileFrame frame)
     : this()
 {
     Frames.Add(frame);
 }