private void InitUI() { int count = 0; for (int i = 0; i < 2; ++i) { for (int j = 0; j < 3; ++j) { if (count < 3) { int index = count; var bt = new CozyColorSampleButton(100, 100, CCColor4B.Blue, CCColor4B.Green) { Text = string.Format("level : {0}", index), Position = new CCPoint(i * (100 + 10), j * (100 + 10)), OnClick = () => { FarmMapLogic.EnterMap(index); } }; this.AddChild(bt); dispatcher.Add(bt); ++count; } } } }
private void InitUI() { EditNode = new CCLabel("", StringManager.GetText("GlobalFont"), 22) { Position = new CCPoint(100, 120), AnchorPoint = CCPoint.Zero, Color = CCColor3B.Blue }; AddChild(EditNode, 100); var Goon = new CozySampleButton(631, 86, 78, 36) { Text = "继续冒险", FontSize = 14, OnClick = () => { FarmMapLogic.EnterMap(PlayerObject.Instance.Self.CurrLevel); } }; AddChild(Goon, 100); dispatcher.Add(Goon); var MercMange = new CozySampleButton(631, 160, 78, 36) { Text = "佣兵管理", FontSize = 14, OnClick = () => { AppDelegate.SharedWindow.DefaultDirector.PushScene(new FollowerListScene()); } }; AddChild(MercMange, 100); dispatcher.Add(MercMange); var MyGoods = new CozySampleButton(631, 227, 78, 36) { Text = "我的物品", FontSize = 14 }; AddChild(MyGoods, 100); dispatcher.Add(MyGoods); var MyFriends = new CozySampleButton(631, 299, 78, 36) { Text = "我的好友", FontSize = 14 }; AddChild(MyFriends, 100); dispatcher.Add(MyFriends); }