//optional add method to add color public static GameSprite Add(GameSprite.Name name, Image.Name ImageName, float x, float y, float width, float height, float red, float green, float blue) { GameSpriteMan pSMan = GameSpriteMan.PrivGetInstance(); Debug.Assert(pSMan != null); GameSprite pSNode = (GameSprite)pSMan.BaseAdd(); Debug.Assert(pSNode != null); Image pImage = ImageMan.Find(ImageName); Debug.Assert(pSNode != null); pSNode.Set(name, pImage, x, y, width, height, new Azul.Color(red, green, blue)); return(pSNode); }
public static GameSprite Add(GameSprite.Name name, Image.Name ImageName, float x, float y, float width, float height, Azul.Color pColor = null) { GameSpriteMan pMan = GameSpriteMan.PrivGetInstance(); Debug.Assert(pMan != null); GameSprite pNode = (GameSprite)pMan.BaseAdd(); Debug.Assert(pNode != null); // Initialize the data Image pImage = ImageMan.Find(ImageName); Debug.Assert(pImage != null); pNode.Set(name, pImage, x, y, width, height, pColor); return(pNode); }
public static GameSprite Add(GameSprite.Name name, Image.Name ImageName, float x, float y, float width, float height, float r, float g, float b, float a) { GameSpriteMan pMan = GameSpriteMan.PrivGetInstance(); Debug.Assert(pMan != null); GameSprite pNode = (GameSprite)pMan.BaseAdd(); Debug.Assert(pNode != null); // Initialize the data Image pImage = ImageMan.Find(ImageName); //Debug.Assert(pImage != null); if (pImage == null) { pImage = ImageMan.Find(Image.Name.Default); Debug.Assert(pImage != null); } pNode.Set(name, pImage, x, y, width, height, new Azul.Color(r, g, b, a)); return(pNode); }