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); } } }
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]"); }
public bool Equals(TileFrame other) { return(TexLoc == other.TexLoc && Sheet == other.Sheet); }
public TileLayer(TileFrame frame) : this() { Frames.Add(frame); }