public override void Load() { timeLeft = moveTime + stayTime; Root.AddChild(new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/fakeLoading.png"))); Root.AddChild(fakeOpacity = new RectangleElement(0, 0, Globals.WIDTH, Globals.HEIGHT, Color.Transparent, Color.Transparent, 0f)); Root.AddChild(logo = new Image(542, 96, new game.Sprite("data/sprites/logo.png"))); Root.AddChild(extra = new Label(0, Globals.HEIGHT / 2f + 200, Globals.WIDTH, 100, "Loading extra assets. Please wait.", LabelStyle.Default.Alter(textAlignmentNormal: FontLoader.CenterCenterAlignment, textSizeNormal: 48f, fontLoaderInstance: FontLoader.SourceCodeBold)) { x = -100000f }); Root.AddChild(extra2 = new Label(0, Globals.HEIGHT / 2f + 250, Globals.WIDTH, 100, "Go grab a beer, get comfortable and get ready to have some fun!", LabelStyle.Default.Alter(textAlignmentNormal: FontLoader.CenterCenterAlignment, textSizeNormal: 32f, fontLoaderInstance: FontLoader.SourceCodeBold)) { x = -100000f }); IsLoaded = true; }
public override void Load() { Root.AddChild(new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/map/map.jpg"))); Root.AddChild(new Button(887, 0, 200, 320, "Fellini", ButtonStyle.Transparent, () => { NetworkManager.Instance.JoinLocation("Fellini"); }, () => { felliniTooltip.x = 612f; }, () => { felliniTooltip.x = -100000f; })); Root.AddChild(new Button(1075, 572, 200, 300, "Rock's", ButtonStyle.Transparent, () => { NetworkManager.Instance.JoinLocation("Rock's"); }, () => { rocksTooltip.x = 800f; }, () => { rocksTooltip.x = -100000f; })); Root.AddChild(new Button(423, 88, 200, 320, "Coffee Fellows", ButtonStyle.Transparent, () => { NetworkManager.Instance.JoinLocation("Coffee Fellows"); }, () => { coffeeTooltip.x = 145f; }, () => { coffeeTooltip.x = -100000f; })); Root.AddChild(coffeeTooltip = new Image(145, 445, 750, 150, new game.Sprite("data/sprites/map/coffee_fellows_slogan.jpg")) { x = -100000f }); Root.AddChild(felliniTooltip = new Image(612, 375, 750, 150, new game.Sprite("data/sprites/map/fellini_slogan.jpg")) { x = -100000f }); Root.AddChild(rocksTooltip = new Image(800, 400, 750, 150, new game.Sprite("data/sprites/map/rocks_slogan.jpg")) { x = -100000f }); IsLoaded = true; }
public override void Load() { var textFieldStyle = TextFieldStyle.Default.Alter(backgroundNormal: Color.Transparent, backgroundFocused: Color.Transparent, borderNormal: Color.FromArgb(255, 255, 255, 0), borderFocused: Color.FromArgb(255, 255, 255, 0), borderSizeNormal: 4f, borderSizeFocused: 4f); var checkboxStyle = CheckboxStyle.Default.Alter(tickColorNormal: Color.FromArgb(255, 255, 255, 0), tickColorHover: Color.FromArgb(255, 255, 255, 0), tickColorPressed: Color.FromArgb(255, 255, 255, 0)); backgroundImage1 = new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/locations/fellini/menu_1.png", false, false)) { x = 0f }; backgroundImage2 = new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/locations/fellini/menu_2.png", false, false)) { x = -100000f }; backgroundImage3 = new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/locations/fellini/menu_3.png", false, false)) { x = -100000f }; Root.AddChild(backgroundImage1); Root.AddChild(backgroundImage2); Root.AddChild(backgroundImage3); var tab1 = new Pivot(); tab2 = new Pivot(); tab2.SetXY(width / 3f, 0f); tab3 = new Pivot(); tab3.SetXY(2f * width / 3f, 0f); Root.AddChild(tab1); Root.AddChild(tab2); Root.AddChild(tab3); var tab1Main = new Pivot(); var tab1CreatePublic = new Pivot { x = -100000f }; var tab1CreatePrivate = new Pivot { x = -100000f }; tab1.AddChild(tab1Main); tab1.AddChild(tab1CreatePublic); tab1.AddChild(tab1CreatePrivate); tab1Main.AddChild(new Button(148, 266, 434, 134, "Create public room", ButtonStyle.Transparent, () => { tab1CreatePublic.x = 0f; backgroundImage2.x = 0f; tab1Main.x = -100000f; backgroundImage1.x = -100000f; })); tab1Main.AddChild(new Button(148, 458, 434, 134, "Create private room", ButtonStyle.Transparent, () => { tab1CreatePrivate.x = 0; backgroundImage3.x = 0f; tab1Main.x = -100000f; backgroundImage1.x = -100000f; })); tab1Main.AddChild(new Button(253, 900, 210, 95, "Back", ButtonStyle.Transparent, () => { NetworkManager.Instance.JoinLocation("none", false); })); tab1CreatePublic.AddChild(publicRoomNameTextField = new TextField(99, 341 - 2, 540, 52, "", textFieldStyle)); tab1CreatePublic.AddChild(publicRoomDescriptionTextField = new TextField(99, 562 - 2, 540, 52, "", textFieldStyle)); tab1CreatePublic.AddChild(publicRoomNSFWCheckbox = new Checkbox(99 + 64f, 670, 540 - 64f, 52, "", checkboxStyle)); tab1CreatePublic.AddChild(new Button(180, 797, 372, 67, "Create", ButtonStyle.Transparent, () => { if (string.IsNullOrEmpty(publicRoomNameTextField.Text) || string.IsNullOrEmpty(publicRoomDescriptionTextField.Text)) { return; } NetworkManager.Instance.CreateAndJoinRoom(publicRoomNameTextField.Text, publicRoomDescriptionTextField.Text, "", publicRoomNSFWCheckbox.IsChecked, true); publicRoomNameTextField.Text = ""; publicRoomDescriptionTextField.Text = ""; publicRoomNSFWCheckbox.IsChecked = false; tab1CreatePublic.x = -100000f; backgroundImage2.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; RefreshRooms(); })); tab1CreatePublic.AddChild(new Button(253, 900, 210, 95, "Back", ButtonStyle.Transparent, () => { tab1CreatePublic.x = -100000f; backgroundImage2.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; })); tab1CreatePrivate.AddChild(privateRoomNameTextField = new TextField(99, 341 - 2, 540, 52, "", textFieldStyle)); tab1CreatePrivate.AddChild(privateRoomDescriptionTextField = new TextField(99, 473 - 2, 540, 52, "", textFieldStyle)); tab1CreatePrivate.AddChild(privateRoomCodeTextField = new TextField(100, 613 - 2, 540, 52, "", textFieldStyle)); tab1CreatePrivate.AddChild(privateRoomNSFWCheckbox = new Checkbox(99 + 64f, 682, 540 - 64f, 52, "", checkboxStyle)); tab1CreatePrivate.AddChild(new Button(180, 797, 372, 67, "Create", ButtonStyle.Transparent, () => { if (string.IsNullOrEmpty(privateRoomNameTextField.Text) || string.IsNullOrEmpty(privateRoomDescriptionTextField.Text) || string.IsNullOrEmpty(privateRoomCodeTextField.Text)) { return; } NetworkManager.Instance.CreateAndJoinRoom(privateRoomNameTextField.Text, privateRoomDescriptionTextField.Text, privateRoomCodeTextField.Text, privateRoomNSFWCheckbox.IsChecked, false); privateRoomNameTextField.Text = ""; privateRoomDescriptionTextField.Text = ""; privateRoomCodeTextField.Text = ""; privateRoomNSFWCheckbox.IsChecked = false; tab1CreatePrivate.x = -100000f; backgroundImage3.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; RefreshRooms(); })); tab1CreatePrivate.AddChild(new Button(253, 900, 210, 95, "Back", ButtonStyle.Transparent, () => { tab1CreatePrivate.x = -100000f; backgroundImage3.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; })); tab2.AddChild(loadingPrivateRooms = new AnimatedSprite(Texture2D.GetInstance("data/sprites/spinner.png", true), 12, 1, 0.083F) { x = -100000f, y = 207 + 64f - 48f, scale = 0.75f }); tab2.AddChild(new Button(370f, 900, 360, 95, "Refresh", ButtonStyle.Transparent, () => { RefreshRooms(); })); tab3.AddChild(loadingPublicRooms = new AnimatedSprite(Texture2D.GetInstance("data/sprites/spinner.png", true), 12, 1, 0.083F) { x = -100000f, y = 207 + 64f - 48f, scale = 0.75f }); RefreshRooms(); IsLoaded = true; }
public override void Load() { var textFieldBackground = Color.FromArgb(255, 73, 65, 54); var textFieldText = Color.FromArgb(255, 227, 227, 222); var textFieldStyle = TextFieldStyle.Default.Alter(backgroundNormal: textFieldBackground, backgroundFocused: textFieldBackground, borderNormal: Color.Transparent, borderFocused: Color.Transparent, borderSizeNormal: 4f, borderSizeFocused: 4f, caretNormal: textFieldText, caretFocused: textFieldText, textNormal: textFieldText, textFocused: textFieldText); var checkboxStyle = CheckboxStyle.Default.Alter(backgroundColorNormal: textFieldBackground, backgroundColorHover: textFieldBackground, backgroundColorPressed: textFieldBackground, borderColorNormal: Color.Transparent, borderColorHover: Color.Transparent, borderColorPressed: Color.Transparent, tickColorHover: textFieldText, tickColorNormal: textFieldText, tickColorPressed: textFieldText); backgroundImage1 = new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/locations/rocks/menu_1.jpg", false, false)) { x = 0f }; backgroundImage2 = new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/locations/rocks/menu_2.jpg", false, false)) { x = -100000f }; backgroundImage3 = new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/locations/rocks/menu_3.jpg", false, false)) { x = -100000f }; Root.AddChild(backgroundImage1); Root.AddChild(backgroundImage2); Root.AddChild(backgroundImage3); var tab1 = new Pivot(); tab2 = new Pivot(); tab2.SetXY(width / 3f, 0f); tab3 = new Pivot(); tab3.SetXY(2f * width / 3f, 0f); Root.AddChild(tab1); Root.AddChild(tab2); Root.AddChild(tab3); var tab1Main = new Pivot(); var tab1CreatePublic = new Pivot { x = -100000f }; var tab1CreatePrivate = new Pivot { x = -100000f }; tab1.AddChild(tab1Main); tab1.AddChild(tab1CreatePublic); tab1.AddChild(tab1CreatePrivate); tab1Main.AddChild(new Button(133, 358, 449, 83, "Create public room", ButtonStyle.Transparent, onClick: () => { tab1CreatePublic.x = 0f; backgroundImage2.x = 0f; tab1Main.x = -100000f; backgroundImage1.x = -100000f; })); tab1Main.AddChild(new Button(133, 509, 449, 83, "Create private room", ButtonStyle.Transparent, onClick: () => { tab1CreatePrivate.x = 0; backgroundImage3.x = 0f; tab1Main.x = -100000f; backgroundImage1.x = -100000f; })); tab1Main.AddChild(new Button(267, 836, 177, 83, "Back", ButtonStyle.Transparent, () => { NetworkManager.Instance.JoinLocation("none", false); })); tab1CreatePublic.AddChild(publicRoomNameTextField = new TextField(111, 315, 499, 60, "", textFieldStyle)); tab1CreatePublic.AddChild(publicRoomDescriptionTextField = new TextField(111, 462, 499, 60, "", textFieldStyle)); tab1CreatePublic.AddChild(publicRoomNSFWCheckbox = new Checkbox(80, 617, 564, 40, "", checkboxStyle)); tab1CreatePublic.AddChild(new Button(190, 679, 338, 83, "Create", ButtonStyle.Transparent, onClick: () => { if (string.IsNullOrEmpty(publicRoomNameTextField.Text) || string.IsNullOrEmpty(publicRoomDescriptionTextField.Text)) { return; } NetworkManager.Instance.CreateAndJoinRoom(publicRoomNameTextField.Text, publicRoomDescriptionTextField.Text, "", publicRoomNSFWCheckbox.IsChecked, true); publicRoomNameTextField.Text = ""; publicRoomDescriptionTextField.Text = ""; publicRoomNSFWCheckbox.IsChecked = false; tab1CreatePublic.x = -100000f; backgroundImage2.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; RefreshRooms(); })); tab1CreatePublic.AddChild(new Button(267, 836, 177, 83, "Back", ButtonStyle.Transparent, onClick: () => { tab1CreatePublic.x = -100000f; backgroundImage2.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; })); tab1CreatePrivate.AddChild(privateRoomNameTextField = new TextField(111, 315, 499, 60, "", textFieldStyle)); tab1CreatePrivate.AddChild(privateRoomDescriptionTextField = new TextField(111, 442, 499, 60, "", textFieldStyle)); tab1CreatePrivate.AddChild(privateRoomCodeTextField = new TextField(111, 568, 499, 60, "", textFieldStyle)); tab1CreatePrivate.AddChild(privateRoomNSFWCheckbox = new Checkbox(85, 650, 560, 40, "", checkboxStyle)); tab1CreatePrivate.AddChild(new Button(191, 709, 338, 83, "Create", ButtonStyle.Transparent, onClick: () => { if (string.IsNullOrEmpty(privateRoomNameTextField.Text) || string.IsNullOrEmpty(privateRoomDescriptionTextField.Text) || string.IsNullOrEmpty(privateRoomCodeTextField.Text)) { return; } NetworkManager.Instance.CreateAndJoinRoom(privateRoomNameTextField.Text, privateRoomDescriptionTextField.Text, privateRoomCodeTextField.Text, privateRoomNSFWCheckbox.IsChecked, false); privateRoomNameTextField.Text = ""; privateRoomDescriptionTextField.Text = ""; privateRoomCodeTextField.Text = ""; privateRoomNSFWCheckbox.IsChecked = false; tab1CreatePrivate.x = -100000f; backgroundImage3.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; RefreshRooms(); })); tab1CreatePrivate.AddChild(new Button(267, 836, 177, 83, "Back", ButtonStyle.Transparent, onClick: () => { tab1CreatePrivate.x = -100000f; backgroundImage3.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; })); tab2.AddChild(loadingPrivateRooms = new AnimatedSprite(Texture2D.GetInstance("data/sprites/spinner.png", true), 12, 1, 0.083F) { x = -100000f, y = 232 + 64f - 48f, scale = 0.75f }); tab2.AddChild(new Button(815f - width / 3f, 838, 283, 83, "Refresh", ButtonStyle.Transparent, onClick: () => { RefreshRooms(); })); tab3.AddChild(loadingPublicRooms = new AnimatedSprite(Texture2D.GetInstance("data/sprites/spinner.png", true), 12, 1, 0.083F) { x = -100000f, y = 232 + 64f - 48f, scale = 0.75f }); tab3.AddChild(new Button(1390 - 2 * width / 3f, 838, 283, 83, "Refresh", ButtonStyle.Transparent, onClick: () => { RefreshRooms(); })); RefreshRooms(); IsLoaded = true; }
public override void Load() { var textFieldStyle = TextFieldStyle.Default.Alter(backgroundNormal: Color.FromArgb(255, 73, 73, 81), backgroundFocused: Color.FromArgb(255, 73, 73, 81), borderNormal: Color.Transparent, borderFocused: Color.Transparent, borderSizeNormal: 4f, borderSizeFocused: 4f, caretNormal: Color.White, caretFocused: Color.White); var checkboxStyle = CheckboxStyle.Default.Alter(backgroundColorNormal: Color.FromArgb(255, 73, 73, 81), backgroundColorHover: Color.FromArgb(255, 73, 73, 81), backgroundColorPressed: Color.FromArgb(255, 73, 73, 81), borderColorNormal: Color.Transparent, borderColorHover: Color.Transparent, borderColorPressed: Color.Transparent); backgroundImage1 = new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/locations/coffee_fellows/menu_1.jpg", true, false)) { x = 0f }; backgroundImage2 = new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/locations/coffee_fellows/menu_2.jpg", true, false)) { x = -100000f }; backgroundImage3 = new Image(0, 0, Globals.WIDTH, Globals.HEIGHT, new game.Sprite("data/sprites/locations/coffee_fellows/menu_3.jpg", true, false)) { x = -100000f }; Root.AddChild(backgroundImage1); Root.AddChild(backgroundImage2); Root.AddChild(backgroundImage3); var tab1 = new Pivot(); tab2 = new Pivot(); tab2.SetXY(width / 3f, 0f); tab3 = new Pivot(); tab3.SetXY(2f * width / 3f, 0f); Root.AddChild(tab1); Root.AddChild(tab2); Root.AddChild(tab3); var tab1Main = new Pivot(); var tab1CreatePublic = new Pivot { x = -100000f }; var tab1CreatePrivate = new Pivot { x = -100000f }; tab1.AddChild(tab1Main); tab1.AddChild(tab1CreatePublic); tab1.AddChild(tab1CreatePrivate); tab1Main.AddChild(new Button(135, 373, 448, 55, "Create public room", ButtonStyle.Transparent, onClick: () => { tab1CreatePublic.x = 0f; backgroundImage2.x = 0f; tab1Main.x = -100000f; backgroundImage1.x = -100000f; })); tab1Main.AddChild(new Button(111, 521, 494, 58, "Create private room", ButtonStyle.Transparent, onClick: () => { tab1CreatePrivate.x = 0; backgroundImage3.x = 0f; tab1Main.x = -100000f; backgroundImage1.x = -100000f; })); tab1Main.AddChild(new Button(253, 851, 168, 65, "Back", ButtonStyle.Transparent, () => { NetworkManager.Instance.JoinLocation("none", false); })); tab1CreatePublic.AddChild(publicRoomNameTextField = new TextField(103, 284, 518, 40, "", textFieldStyle)); tab1CreatePublic.AddChild(publicRoomDescriptionTextField = new TextField(103, 422, 518, 40, "", textFieldStyle)); tab1CreatePublic.AddChild(publicRoomNSFWCheckbox = new Checkbox(103 - 16f, 507, 518 + 16f, 40, "", checkboxStyle)); tab1CreatePublic.AddChild(new Button(200, 597, 293, 57, "Create", ButtonStyle.Transparent, onClick: () => { if (string.IsNullOrEmpty(publicRoomNameTextField.Text) || string.IsNullOrEmpty(publicRoomDescriptionTextField.Text)) { return; } NetworkManager.Instance.CreateAndJoinRoom(publicRoomNameTextField.Text, publicRoomDescriptionTextField.Text, "", publicRoomNSFWCheckbox.IsChecked, true); publicRoomNameTextField.Text = ""; publicRoomDescriptionTextField.Text = ""; publicRoomNSFWCheckbox.IsChecked = false; tab1CreatePublic.x = -100000f; backgroundImage2.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; RefreshRooms(); })); tab1CreatePublic.AddChild(new Button(253, 851, 168, 65, "Back", ButtonStyle.Transparent, onClick: () => { tab1CreatePublic.x = -100000f; backgroundImage2.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; })); tab1CreatePrivate.AddChild(privateRoomNameTextField = new TextField(103, 284, 518, 40, "", textFieldStyle)); tab1CreatePrivate.AddChild(privateRoomDescriptionTextField = new TextField(103, 403, 518, 40, "", textFieldStyle)); tab1CreatePrivate.AddChild(privateRoomCodeTextField = new TextField(103, 528, 518, 40, "", textFieldStyle)); tab1CreatePrivate.AddChild(privateRoomNSFWCheckbox = new Checkbox(103 - 16f, 595, 518 + 16f, 40, "", checkboxStyle)); tab1CreatePrivate.AddChild(new Button(200, 640, 293, 57, "Create", ButtonStyle.Transparent, onClick: () => { if (string.IsNullOrEmpty(privateRoomNameTextField.Text) || string.IsNullOrEmpty(privateRoomDescriptionTextField.Text) || string.IsNullOrEmpty(privateRoomCodeTextField.Text)) { return; } NetworkManager.Instance.CreateAndJoinRoom(privateRoomNameTextField.Text, privateRoomDescriptionTextField.Text, privateRoomCodeTextField.Text, privateRoomNSFWCheckbox.IsChecked, false); privateRoomNameTextField.Text = ""; privateRoomDescriptionTextField.Text = ""; privateRoomCodeTextField.Text = ""; privateRoomNSFWCheckbox.IsChecked = false; tab1CreatePrivate.x = -100000f; backgroundImage3.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; RefreshRooms(); })); tab1CreatePrivate.AddChild(new Button(253, 851, 168, 65, "Back", ButtonStyle.Transparent, onClick: () => { tab1CreatePrivate.x = -100000f; backgroundImage3.x = -100000f; tab1Main.x = 0f; backgroundImage1.x = 0f; })); tab2.AddChild(loadingPrivateRooms = new AnimatedSprite(Texture2D.GetInstance("data/sprites/spinner.png", true), 12, 1, 0.083F) { x = -100000f, y = 250 + 64f - 48f, scale = 0.75f }); tab2.AddChild(new Button(809f - width / 3f, 858, 270, 65, "Refresh", ButtonStyle.Transparent, onClick: () => { RefreshRooms(); })); tab3.AddChild(loadingPublicRooms = new AnimatedSprite(Texture2D.GetInstance("data/sprites/spinner.png", true), 12, 1, 0.083F) { x = -100000f, y = 250 + 64f - 48f, scale = 0.75f }); tab3.AddChild(new Button(1400 - 2 * width / 3f, 858, 270, 65, "Refresh", ButtonStyle.Transparent, onClick: () => { RefreshRooms(); })); RefreshRooms(); IsLoaded = true; }