I have a game project built upon Cocos2D XNA and MonoGame. I wanted to add a little bit of custom logic into CCSprite class, so I created a class which inherits from CCSprite. I added a dummy auto property and tried to use this class, but for some reason sprites being created as instances of my custom sprite class are not shown on the layer, while sprites which are instances of CCSprite class - are completely OK.
Code looks like this:
public class Sprite: CCSprite {
public string SomeProp {get; set;}
}
...
line1: var mySprite1 = new Sprite("texture.png");
line2: var mySprite1 = new CCSprite("texture.png");
AddChild(mySprite1);
If I use line1 and comment out line 2, then mySprite 1 is not shown. Otherwise - if mySprite is an instance of CCSprite - it works well.
What could be the source of this problem?