public override void Update(float dt) { base.Update(dt); elapsedTime += dt; if (elapsedTime > 3f) { if (_TheTexture != null) { _TheTexture.XNATexture.Dispose(); _TheTexture = null; } CreateTheButtons(); elapsedTime = 0f; var title = new CCLabelTTF("Refreshing the buttons", "Arial", 30); AddChild(title, 25); title.Position = ContentSize.Center; title.RunAction(new CCFadeOut(1f)); } }
public LabelTTFA8Test() { CCSize s = CCDirector.SharedDirector.WinSize; CCLayerColor layer = new CCLayerColor(new CCColor4B(128, 128, 128, 255)); AddChild(layer, -10); // CCLabelBMFont CCLabelTTF label1 = new CCLabelTTF("Testing A8 Format", "Marker Felt", 38); AddChild(label1); label1.Color = CCTypes.CCRed; label1.Position = new CCPoint(s.Width / 2, s.Height / 2); CCFadeOut fadeOut = new CCFadeOut(2); CCFadeIn fadeIn = new CCFadeIn(2); CCFiniteTimeAction seq = CCSequence.FromActions(fadeOut, fadeIn); CCRepeatForever forever = new CCRepeatForever((CCActionInterval)seq); label1.RunAction(forever); }
public void onCallback1(CCNode sender) { // Rotate the label when the button is pressed helloLabel.RunAction(new CCRotateBy(1, 360)); helloLabel.Text = "Callback 1"; }