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(SystemFontTestScene.restartAction()); }
public SystemFontTest() { 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(SystemFontTestScene.restartAction()); }
public SystemFontTest() { size = Layer.VisibleBoundsWorldspace.Size; 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(size.Width / 2 - item2.ContentSize.Width * 2, item2.ContentSize.Height / 2); item2.Position = new CCPoint(size.Width / 2, item2.ContentSize.Height / 2); item3.Position = new CCPoint(size.Width / 2 + item2.ContentSize.Width * 2, item2.ContentSize.Height / 2); AddChild(menu, 1); blockSize = new CCSize(size.Width / 3, 200); var leftColor = new CCLayerColor(new CCColor4B(100, 100, 100, 255)); var centerColor = new CCLayerColor(new CCColor4B(200, 100, 100, 255)); var rightColor = new CCLayerColor(new CCColor4B(100, 100, 200, 255)); leftColor.IgnoreAnchorPointForPosition = false; centerColor.IgnoreAnchorPointForPosition = false; rightColor.IgnoreAnchorPointForPosition = false; leftColor.AnchorPoint = CCPoint.AnchorMiddleLeft; centerColor.AnchorPoint = CCPoint.AnchorMiddleLeft; rightColor.AnchorPoint = CCPoint.AnchorMiddleLeft; leftColor.Position = new CCPoint(0, size.Height / 2); centerColor.Position = new CCPoint(blockSize.Width, size.Height / 2); rightColor.Position = new CCPoint(blockSize.Width * 2, size.Height / 2); AddChild(leftColor, -1); AddChild(rightColor, -1); AddChild(centerColor, -1); showFont(SystemFontTestScene.restartAction()); }
public override void RestartCallback(object sender) { base.RestartCallback(sender); showFont(SystemFontTestScene.restartAction()); }
public void restartCallback(object pSender) { showFont(SystemFontTestScene.restartAction()); }