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 RefreshMapInfo() { Level = PlayerObject.Instance.Self.CurrLevel; MoneyAdd = FarmMapLogic.Money(Level); ExpAdd = FarmMapLogic.Exp(Level); MapInfoLabel.Text = string.Format("当前地点 : {0} 金币速度 : {1} 经验 : {2}", Level, MoneyAdd, ExpAdd); }
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); }
private void InitUI() { PlayerInfoLabel = new CCLabel("", "Consolas", 14) { Position = new CCPoint(37, 36), Color = CCColor3B.White, }; MapInfoLabel = new CCLabel("", "Consolas", 14) { Position = new CCPoint(37, 55), Color = CCColor3B.White, }; this.AddChild(PlayerInfoLabel, 100); this.AddChild(MapInfoLabel, 100); var Details = new CozySampleButton(542, 38, 78, 36) { Text = "详情", FontSize = 14 }; AddChild(Details, 100); dispatcher.Add(Details); var DoCamp = new CozySampleButton(630, 38, 78, 36) { Text = "安营", FontSize = 14, OnClick = () => { FarmMapLogic.GoToCamp(); }, }; AddChild(DoCamp, 100); dispatcher.Add(DoCamp); var Leave = new CozySampleButton(718, 38, 78, 36) { Text = "离开", FontSize = 14, OnClick = () => { FarmMapLogic.ExitMap(); }, }; AddChild(Leave, 100); dispatcher.Add(Leave); }
public override void OnEnter() { base.OnEnter(); RefreshPlayerInfo(); RefreshMapInfo(); RegisterEvent(); var need = FarmMapLogic.Requirement(PlayerObject.Instance.Self.CurrLevel); var attget = FollowerCollectLogic.GetAttack(PlayerObject.Instance.Self.FightFollower); if (need <= attget) { Schedule(OnTimerAnimation, 1.0f); } dispatcher.AttachListener(this); }