Minimum requirements to display a basic sprite on WinDX

RyanDavisRyanDavis AUInsider, University ✭✭

What do I need to do to display a sprite on screen in a Windows Cocos application?

I have tried the below:

  • Create a 'Content' folder in the Windows project
  • Create an 'Img' folder in the Windows project, add 'image.png', set Build Action to .. ?
  • In my app delegate subclass, in ApplicationDidFinishLaunching, set application.ContentRootDirectory = "Content", then application.ContentSearchPaths.Add("Img")
  • In my layer class , in AddedToScene, create a sprite with new CCSprite("image.png") { Position = VisibleBoundsWorldSpace.Center }; , then AddChild(sprite);

Now I expect to see the image in the middle of the screen, but there is nothing displayed! Some quick debugging shows that ContentSize is 0,0. If I try to create the sprite in two steps using a texture, the texture has a 0,0 contentsize and does not appear to have loaded the image. However, there is no debug output or information that suggests what could be wrong.

Any ideas?

Sign In or Register to comment.