Sign up ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm trying to get a CCControlButton to render on my game. Using a basic CCScale9Sprite as the button's background works using the following:

var myScale9Sprite = CCScale9Sprite.Create(@"UI\Button50x50");
var label = CCLabelTTF.Create("Return To City", "Arial", 70);

var button = CCControlButton.Create(label, myScale9Sprite);
button.Position = new CCPoint(200, 200);


The text doesn't fit nicely in the button. As I understand it, CCScale9Sprite's Inset properties are used to define how the content works. But every attempt I have made to use this property results in the background sprite disapearing completely. This is the offending code:

// Using a 50x50 image with a 10 pixel border
myScale9Sprite.CapInsets = new CCRect(10,10,30,30);

Any attempt to set Insets, using either CapInsets, InsetLeft, InsetRight, InsetTop, InsetBottom, or even specifying a CCRect in CCControlButton.Create results in the same issue.

Is my usage correct?

Is it just not implemented correctly in the xna branch? I had this issue with the build I have been using for the last 6 months, so downloaded the latest (2013/03/24) source from github and still have the same issue. Looking at the source, there's nothing to suggest that its not implemented.

share|improve this question

closed as off-topic by Josh Petrie Dec 22 '14 at 21:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about debugging a problem in your project must present a concise selection of code and context so as to allow a reader to diagnose the issue without needing to read all of your code or to engage in extensive back-and-forth dialog. For more information, see this meta thread." – Josh Petrie
If this question can be reworded to fit the rules in the help center, please edit the question.