public Sprite(string path, Vector2 startPos = null) { Image = new ImageGraphic(path); if (startPos != null) { Position = startPos; } else { Position = new Vector2(0, 0); } }
public void Render(CardRenderWindow handle) { List<Vector2> cardPos = new List<Vector2>(); Vector2 current = Position.Clone() as Vector2; for (int i = 0; i < InnerPile.Count; i += CARDS_PER_IMG) { cardPos.Add(current.Clone() as Vector2); current.X += OFFSET_PER_CARD / 2; current.Y += OFFSET_PER_CARD; } for (int i = cardPos.Count - 1; i >= 0; i--) { IGraphic back = new ImageGraphic(BACK_FILENAME); handle.RenderImage(back, cardPos[i]); } }
public void Render(CardRenderWindow handle) { IGraphic img = new ImageGraphic(InternalCard.ImagePath()); handle.RenderImage(img, Position); }