public override void OnEnter() { base.OnEnter(); var s = VisibleBoundsWorldspace.Size; var blockSize = new CCSize(s.Width / 3, s.Height / 2); //blockSize = new CCSize(50, 50); var leftColor = new Background(blockSize, new CCColor4B(100, 100, 100, 255)); var centerColor = new Background(blockSize, new CCColor4B(200, 100, 100, 255)); var rightColor = new Background(blockSize, new CCColor4B(100, 100, 200, 255)); leftColor.IgnoreAnchorPointForPosition = false; centerColor.IgnoreAnchorPointForPosition = false; rightColor.IgnoreAnchorPointForPosition = false; leftColor.AnchorPoint = new CCPoint(0, 0.5f); centerColor.AnchorPoint = new CCPoint(0, 0.5f); rightColor.AnchorPoint = new CCPoint(0, 0.5f); leftColor.Position = new CCPoint(0, s.Height / 2); centerColor.Position = new CCPoint(blockSize.Width, s.Height / 2); rightColor.Position = new CCPoint(blockSize.Width * 2, s.Height / 2); AddChild(leftColor, -1); AddChild(rightColor, -1); AddChild(centerColor, -1); showFont(FontTestScene.restartAction()); }
public override void OnEnter() { base.OnEnter(); var leftColor = new Background(blockSize, new CCColor4B(100, 100, 100, 255)); var centerColor = new Background(blockSize, new CCColor4B(200, 100, 100, 255)); var rightColor = new Background(blockSize, new CCColor4B(100, 100, 200, 255)); leftColor.IgnoreAnchorPointForPosition = false; centerColor.IgnoreAnchorPointForPosition = false; rightColor.IgnoreAnchorPointForPosition = false; leftColor.AnchorPoint = new CCPoint(0, 0.5f); centerColor.AnchorPoint = new CCPoint(0, 0.5f); rightColor.AnchorPoint = new CCPoint(0, 0.5f); leftColor.Position = new CCPoint(0, visibleRect.Height / 2); centerColor.Position = new CCPoint(blockSize.Width, visibleRect.Height / 2); rightColor.Position = new CCPoint(blockSize.Width * 2, visibleRect.Height / 2); AddChild(leftColor, -1); AddChild(rightColor, -1); AddChild(centerColor, -1); showFont(FontTestScene.restartAction()); }
public FontTest() { CCSize s = CCDirector.SharedDirector.WinSize; CCMenuItemImage item1 = new CCMenuItemImage(TestResource.s_pPathB1, TestResource.s_pPathB2, backCallback); CCMenuItemImage item2 = new CCMenuItemImage(TestResource.s_pPathR1, TestResource.s_pPathR2, restartCallback); CCMenuItemImage item3 = new CCMenuItemImage(TestResource.s_pPathF1, TestResource.s_pPathF2, nextCallback); CCMenu menu = new CCMenu(item1, item2, item3); menu.Position = CCPoint.Zero; item1.Position = new CCPoint(s.Width / 2 - item2.ContentSize.Width * 2, item2.ContentSize.Height / 2); item2.Position = new CCPoint(s.Width / 2, item2.ContentSize.Height / 2); item3.Position = new CCPoint(s.Width / 2 + item2.ContentSize.Width * 2, item2.ContentSize.Height / 2); AddChild(menu, 1); showFont(FontTestScene.restartAction()); }
public FontTest() { CCSize s = CCDirector.SharedDirector.WinSize; CCMenuItemImage item1 = new CCMenuItemImage(TestResource.s_pPathB1, TestResource.s_pPathB2, backCallback); CCMenuItemImage item2 = new CCMenuItemImage(TestResource.s_pPathR1, TestResource.s_pPathR2, restartCallback); CCMenuItemImage item3 = new CCMenuItemImage(TestResource.s_pPathF1, TestResource.s_pPathF2, nextCallback); CCMenu menu = new CCMenu(item1, item2, item3); menu.Position = CCPoint.Zero; item1.Position = new CCPoint(s.Width / 2 - item2.ContentSize.Width * 2, item2.ContentSize.Height / 2); item2.Position = new CCPoint(s.Width / 2, item2.ContentSize.Height / 2); item3.Position = new CCPoint(s.Width / 2 + item2.ContentSize.Width * 2, item2.ContentSize.Height / 2); AddChild(menu, 1); var blockSize = new CCSize(s.Width / 3, 200); CCLayerColor leftColor = new CCLayerColor(new CCColor4B(100, 100, 100, 255), blockSize.Width, blockSize.Height); CCLayerColor centerColor = new CCLayerColor(new CCColor4B(200, 100, 100, 255), blockSize.Width, blockSize.Height); CCLayerColor rightColor = new CCLayerColor(new CCColor4B(100, 100, 200, 255), blockSize.Width, blockSize.Height); leftColor.IgnoreAnchorPointForPosition = false; centerColor.IgnoreAnchorPointForPosition = false; rightColor.IgnoreAnchorPointForPosition = false; leftColor.AnchorPoint = new CCPoint(0, 0.5f); centerColor.AnchorPoint = new CCPoint(0, 0.5f); rightColor.AnchorPoint = new CCPoint(0, 0.5f); leftColor.Position = new CCPoint(0, s.Height / 2); ; centerColor.Position = new CCPoint(blockSize.Width, s.Height / 2); rightColor.Position = new CCPoint(blockSize.Width * 2, s.Height / 2); AddChild(leftColor, -1); AddChild(rightColor, -1); AddChild(centerColor, -1); showFont(FontTestScene.restartAction()); }
public void restartCallback(object pSender) { showFont(FontTestScene.restartAction()); }
public override void RestartCallback(object sender) { base.RestartCallback(sender); showFont(FontTestScene.restartAction()); }