public void AddSprite(Main.Sprite sp) { if (sp == null || m_bitmap == null) { return; } for (int i = 0; i < m_atlasEntries.Count; i++) { if (m_atlasEntries[i].Sprite.Id == sp.Id) { return; // If the sprite has already been added to the atlas, return without adding again } } // Create new atlas entry SpriteAtlasEntry newEntry = new SpriteAtlasEntry(); newEntry.Sprite = sp; // Add it to the list m_atlasEntries.Add(newEntry); // Redraw the bitmap RedrawBitmap(); // Recalculate all texture coords RecalculateTexCoords(); }
public RenderObject(RectangleShape _r, Colour4b _c, Main.Sprite _sprite, bool _shs) { rectangle = _r; colour = _c; sprite = _sprite; renderSprite = _shs; }