public virtual void initWithQuantityOfNodes(int nNodes) { //srand(time()); CCSize s = Layer.VisibleBoundsWorldspace.Size; // Title var label = new CCLabel(title(), "arial", 32, CCLabelFormat.SpriteFont); AddChild(label, 1); label.Position = new CCPoint(s.Width / 2, s.Height - 32); label.Color = new CCColor3B(255, 255, 40); // Subtitle string strSubTitle = subtitle(); if (strSubTitle.Length > 0) { var l = new CCLabel(strSubTitle, "arial", 16, CCLabelFormat.SpriteFont); AddChild(l, 1); l.Position = new CCPoint(s.Width / 2, s.Height - 80); } lastRenderedCount = 0; currentQuantityOfNodes = 0; quantityOfNodes = nNodes; CCMenuItemFont.FontSize = 64; CCMenuItemFont.FontName = "arial"; CCMenuItemFont decrease = new CCMenuItemFont(" - ", onDecrease); decrease.Color = new CCColor3B(0, 200, 20); CCMenuItemFont increase = new CCMenuItemFont(" + ", onIncrease); increase.Color = new CCColor3B(0, 200, 20); CCMenu menu = new CCMenu(decrease, increase); menu.AlignItemsHorizontally(); menu.Position = new CCPoint(s.Width / 2, s.Height / 2 + 15); AddChild(menu, 1); var infoLabel = new CCLabel("0 nodes", "arial", 30, CCLabelFormat.SpriteFont); infoLabel.Color = new CCColor3B(0, 200, 20); infoLabel.Position = new CCPoint(s.Width / 2, s.Height / 2 - 15); AddChild(infoLabel, 1, PerformanceNodeChildrenTest.kTagInfoLayer); NodeChildrenMenuLayer pMenu = new NodeChildrenMenuLayer(true, PerformanceNodeChildrenTest.TEST_COUNT, PerformanceNodeChildrenTest.s_nCurCase); AddChild(pMenu); updateQuantityLabel(); updateQuantityOfNodes(); }
public virtual void initWithQuantityOfNodes(int nNodes) { //srand(time()); CCSize s = CCDirector.sharedDirector().getWinSize(); // Title CCLabelTTF label = CCLabelTTF.labelWithString(title(), "Arial", 40); addChild(label, 1); label.position = new CCPoint(s.width / 2, s.height - 32); label.Color = new ccColor3B(255, 255, 40); // Subtitle string strSubTitle = subtitle(); if (strSubTitle.Length > 0) { CCLabelTTF l = CCLabelTTF.labelWithString(strSubTitle, "Thonburi", 16); addChild(l, 1); l.position = new CCPoint(s.width / 2, s.height - 80); } lastRenderedCount = 0; currentQuantityOfNodes = 0; quantityOfNodes = nNodes; CCMenuItemFont.FontSize = 65; CCMenuItemFont decrease = CCMenuItemFont.itemFromString(" - ", this, onDecrease); decrease.Color = new ccColor3B(0, 200, 20); CCMenuItemFont increase = CCMenuItemFont.itemFromString(" + ", this, onIncrease); increase.Color = new ccColor3B(0, 200, 20); CCMenu menu = CCMenu.menuWithItems(decrease, increase); menu.alignItemsHorizontally(); menu.position = new CCPoint(s.width / 2, s.height / 2 + 15); addChild(menu, 1); CCLabelTTF infoLabel = CCLabelTTF.labelWithString("0 nodes", "Marker Felt", 30); infoLabel.Color = new ccColor3B(0, 200, 20); infoLabel.position = new CCPoint(s.width / 2, s.height / 2 - 15); addChild(infoLabel, 1, PerformanceNodeChildrenTest.kTagInfoLayer); NodeChildrenMenuLayer pMenu = new NodeChildrenMenuLayer(true, PerformanceNodeChildrenTest.TEST_COUNT, PerformanceNodeChildrenTest.s_nCurCase); addChild(pMenu); updateQuantityLabel(); updateQuantityOfNodes(); }
public virtual void initWithQuantityOfNodes(int nNodes) { //srand(time()); CCSize s = CCDirector.SharedDirector.WinSize; // Title CCLabelTTF label = new CCLabelTTF(title(), "arial", 32); AddChild(label, 1); label.Position = new CCPoint(s.Width / 2, s.Height - 32); label.Color = new CCColor3B(255, 255, 40); // Subtitle string strSubTitle = subtitle(); if (strSubTitle.Length > 0) { CCLabelTTF l = new CCLabelTTF(strSubTitle, "arial", 16); AddChild(l, 1); l.Position = new CCPoint(s.Width / 2, s.Height - 80); } lastRenderedCount = 0; currentQuantityOfNodes = 0; quantityOfNodes = nNodes; CCMenuItemFont.FontSize = 64; CCMenuItemFont decrease = CCMenuItemFont.Create(" - ", onDecrease); decrease.Color = new CCColor3B(0, 200, 20); CCMenuItemFont increase = CCMenuItemFont.Create(" + ", onIncrease); increase.Color = new CCColor3B(0, 200, 20); CCMenu menu = CCMenu.Create(decrease, increase); menu.AlignItemsHorizontally(); menu.Position = new CCPoint(s.Width / 2, s.Height / 2 + 15); AddChild(menu, 1); CCLabelTTF infoLabel = new CCLabelTTF("0 nodes", "arial", 30); infoLabel.Color = new CCColor3B(0, 200, 20); infoLabel.Position = new CCPoint(s.Width / 2, s.Height / 2 - 15); AddChild(infoLabel, 1, PerformanceNodeChildrenTest.kTagInfoLayer); NodeChildrenMenuLayer pMenu = new NodeChildrenMenuLayer(true, PerformanceNodeChildrenTest.TEST_COUNT, PerformanceNodeChildrenTest.s_nCurCase); AddChild(pMenu); updateQuantityLabel(); updateQuantityOfNodes(); }