private void InitUI() { var title = new CCLabel("冒险与编程", StringManager.GetText("GlobalFont"), 72) { Position = new CCPoint(400, 320), Color = CCColor3B.Yellow }; AddChild(title, 100); var begin = new CozySampleButton(200, 100, 200, 80) { // 测试代码 // Text = "开始游戏", Text = StringManager.GetText("str3"), FontSize = 24, OnClick = new Action(OnBeginButtonDown), }; AddChild(begin, 100); dispatcher.Add(begin); var reg = new CozySampleButton(690, 0, 100, 50) { Text = "注册帐号", FontSize = 18, OnClick = new Action(OnRegisterButton), }; AddChild(reg, 100); dispatcher.Add(reg); }
public LoginUiLayer() { var title = new CCLabel("冒险与编程", "微软雅黑", 72) { Position = new CCPoint(400, 320), Color = CCColor3B.Yellow }; AddChild(title, 100); var begin = new CozySampleButton(300, 100, 200, 80) { Text = "开始游戏", FontSize = 24, OnClick = new Action(OnBeginButtonDown), }; AddEventListener(begin.EventListener); AddChild(begin, 100); var reg = new CozySampleButton(690, 0, 100, 50) { Text = "注册帐号", FontSize = 18, OnClick = new Action(OnRegisterButton), }; AddEventListener(reg.EventListener); AddChild(reg, 100); }
public CampUiLayer() { var edit = new CCLabel("战斗力:"+Fighting+"金币"+Gold+"经验"+Exper, "微软雅黑", 22) { Position = new CCPoint(100, 120), Color = CCColor3B.Blue }; AddChild(edit, 100); var Goon = new CozySampleButton(631, 86, 78, 36) { Text = "继续冒险", FontSize = 14 }; AddChild(Goon, 100); var MercMange = new CozySampleButton(631, 160, 78, 36) { Text = "佣兵管理", FontSize = 14 }; AddChild(MercMange, 100); var MyGoods = new CozySampleButton(631, 227, 78, 36) { Text = "我的物品", FontSize = 14 }; AddChild(MyGoods, 100); var MyFriends = new CozySampleButton(631, 299, 78, 36) { Text = "我的好友", FontSize = 14 }; AddChild(MyFriends, 100); }
public FollowerListUiLayer() { var listlable = new CCLabel("佣兵列表", "微软雅黑", 14) { Position = new CCPoint(92, 20), Color = CCColor3B.Black }; AddChild(listlable, 100); for (int i = 1; i <= 12; i++) { for (int a = 92; a <= 543; a += 148) { for (int b = 52; b <= 289; b += 119) { var Follower = new CozySampleButton(a, b, 120, 100) { Text = "佣兵" + i, FontSize = 14 }; AddChild(Follower, 100); } } } int c = 20; int d = 30; var AllFollower = new CCLabel("总数" + c + "/" + d, "微软雅黑", 14) { Position = new CCPoint(92, 420), Color = CCColor3B.White, }; AddChild(AllFollower, 100); int e = 20; int f = 30; var PageNumber = new CCLabel(e + "/" + f, "微软雅黑", 14) { Position = new CCPoint(389, 420), Color = CCColor3B.Black }; AddChild(PageNumber, 100); var LastPage = new CozySampleButton(473, 410, 78, 36) { Text = "上一页", FontSize = 14 }; AddChild(LastPage, 100); var NextPage = new CozySampleButton(585, 410, 78, 36) { Text = "下一页", FontSize = 14 }; AddChild(NextPage, 100); }
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); }
public RegistUiLayer() { var title = new CCLabel("冒险与编程", "Consolas", 72) { Position = new CCPoint(400, 320), Color = CCColor3B.Yellow }; AddChild(title, 100); var begin = new CozySampleButton(300, 100, 200, 80) { Text = "开始游戏", FontSize = 24 }; AddChild(begin, 100); }
public FollowerDetailSprite() { ContentSize = new CCSize(435, 280); HasBorder = true; CurrName = new CCLabel("", "Consolas", 14); CurrDesc = new CCLabel("", "Consolas", 14); CurrStar = new CCLabel("", "Consolas", 14); CurrLevel = new CCLabel("", "Consolas", 14); CurrAttack = new CCLabel("", "Consolas", 14); CloseButton = new CozySampleButton(20, 20) { Text = "X", FontSize = 20, HasBorder = true, OnClick = () => { this.Visible = false; } }; StatusChangeButton = new CozySampleButton(40, 20) { Text = "", HasBorder = true, OnClick = () => { if(FightStatusChangeCallback != null) { FightStatusChangeCallback(currFollower); } } }; this.AddChild(CurrName); this.AddChild(CurrDesc); this.AddChild(CurrStar); this.AddChild(CurrLevel); this.AddChild(CurrAttack); this.AddChild(CloseButton); this.AddChild(StatusChangeButton); dispatcher.Add(CloseButton); dispatcher.Add(StatusChangeButton); dispatcher.AttachListener(this); }
public AdventureUiLayer() { int Fighting = 0; int Gold = 0; int Exper = 0; var edit = new CCLabel("战斗力:" + Fighting + "金币" + Gold + "经验" + Exper, "微软雅黑", 14) { Position = new CCPoint(37, 36), Color = CCColor3B.Blue }; AddChild(edit, 100); var Forest = 0; var GoldSpeed = 0; var ExperSpeed = 0; var edit1 = new CCLabel("当前地点:" + Forest + "金币速度" + GoldSpeed + "经验" + ExperSpeed, "微软雅黑", 14) { Position = new CCPoint(37, 55), Color = CCColor3B.Black }; AddChild(edit1, 100); var Details = new CozySampleButton(542, 38, 78, 36) { Text = "详情", FontSize = 14 }; AddChild(Details,100); var DoCamp = new CozySampleButton(630,38,78,36) { Text = "安营", FontSize = 14 }; AddChild(DoCamp, 100); var Leave = new CozySampleButton(718,38,78,36) { Text = "离开", FontSize = 14 }; AddChild(Leave,100); }
private void InitUI() { var listlable = new CCLabel("佣兵列表", StringManager.GetText("GlobalFont"), 14) { Position = new CCPoint(100, 420), Color = CCColor3B.White }; FollowerList = PlayerObject.Instance.Self.AllFollower; Page = (FollowerList.Followers.Count + 8) / 9; AddChild(listlable, 100); foreach (var obj in FollowerList.Followers) { var fs = new FollowerSprite(obj, true); this.AddChild(fs); SpriteList.Add(fs); } var listview = new CozySampleListView() { ContentSize = new CCSize(600, 330), HasBorder = true, Position = new CCPoint(100, 60) }; this.AddChild(listview); InnerList = new CozySampleListView[3]; for (int i = 0; i < 3; ++i) { InnerList[i] = new CozySampleListView() { ContentSize = new CCSize(200, 330), Orientation = Public.Controls.Enum.ControlOrientation.Vertical, }; listview.AddItem(new CozySampleListViewItem(InnerList[i])); } int fight = PlayerObject.Instance.Self.FightFollower.Followers.Count; AllFollower = new CCLabel("总数" + fight + "/" + FollowerList.Followers.Count, StringManager.GetText("GlobalFont"), 14) { Position = new CCPoint(92, 37), Color = CCColor3B.White, }; AddChild(AllFollower, 100); PageNumber = new CCLabel((CurPage + 1) + "/" + Page, StringManager.GetText("GlobalFont"), 14) { Position = new CCPoint(389, 37), Color = CCColor3B.White }; AddChild(PageNumber, 100); ShowDetail = new FollowerDetailSprite() { Position = new CCPoint(100, 100), AnchorPoint = CCPoint.Zero, Visible = false, FightStatusChangeCallback = new Action<Follower>(OnStatusChange), }; this.AddChild(ShowDetail, 201); LastPageButton = new CozySampleButton(473, 17, 78, 36) { Text = "上一页", FontSize = 14, OnClick = () => PrevPage(), }; NextPageButton = new CozySampleButton(585, 17, 78, 36) { Text = "下一页", FontSize = 14, OnClick = () => NextPage(), }; AddChild(NextPageButton, 100); AddChild(LastPageButton, 100); uidispatcher.Add(NextPageButton); uidispatcher.Add(LastPageButton); var backButton = new CozySampleButton(650, 17, 78, 36) { Text = "返回", FontSize = 14, OnClick = () => { AppDelegate.SharedWindow.DefaultDirector.PopScene(); } }; AddChild(backButton, 100); uidispatcher.Add(backButton); }
private void PatternFollower() { int count = CurPage * 9; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { if (count < FollowerList.Followers.Count) { int index = count; var item = new CozySampleListViewItem(SpriteList[index]) { MarginTop = 5, MarginBottom = 5, }; var button = new CozySampleButton(item.ContentSize.Width, item.ContentSize.Height) { OnClick = () => { if (!ShowDetail.Visible) { ShowDetail.CurrFollower = SpriteList[index].BindFollower; ShowDetail.Visible = true; } }, }; item.AddChild(button); dispatcher.Add(button); SpriteList[index].Visible = true; InnerList[i].AddItem(item); } count++; } } }
private void InitUI() { var s = VisibleBoundsWorldspace.Size; NameText = new CCTextField("[Name]", "Consolas", 16) { Position = new CCPoint(s.Width / 2, 400), AutoEdit = true, }; AddChild(NameText, 100); FiledList.Add(NameText); PassText = new CCTextField("[Pass]", "Consolas", 16) { Position = new CCPoint(s.Width / 2, 350), AutoEdit = true, }; AddChild(PassText, 100); FiledList.Add(PassText); PassRepeatText = new CCTextField("[Pass Repeat]", "Consolas", 16) { Position = new CCPoint(s.Width / 2, 300), AutoEdit = true, }; AddChild(PassRepeatText, 100); FiledList.Add(PassRepeatText); NickNameText = new CCTextField("[NickName]", "Consolas", 16) { Position = new CCPoint(s.Width / 2, 250), AutoEdit = true, }; AddChild(NickNameText, 100); FiledList.Add(NickNameText); CurrButton = new CozySampleButton(s.Width / 2, 100, 200, 80) { Text = "注册账号", FontSize = 24, OnClick = () => OnRegister() }; AddChild(CurrButton, 100); dispatcher.Add(CurrButton); }
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); }