I have this code:
Inside of a class extended from cc.Sprite.
When I call:
It gives me the x and y but width and height are zero.
I have pre-loaded the sprite sheet like this in main.js:
What am I doing wrong? do I need to preload the texture somehow???