public SimpleButton(string title, float width, float height, SimpleButtonColor color, bool isPressTap,string fontName) { _isPressTap = isPressTap; this.effectManager = Core.topEffectManager; _color = color; AddChild(button = new FSliceButton(width,height,_color.path,_color.path)); //button.SetPosition(0.25f,0.33f);//pixel perfect? AddChild(mainLabel = new DualLabel(fontName,title,Color.white,TOColors.TEXT_SHADOW)); mainLabel.y = 2.5f; if(_isPressTap) { button.SignalPress += (b) => DoTap(); } else { button.SignalRelease += (b) => DoTap(); } _overHighlight = new FSliceSprite("UI/ButtonHighlight",width,height,12,12,12,12); _overHighlight.alpha = 0.45f; ListenForUpdate(HandleUpdate); UpdateEnabled(); }
public SimpleButton(string title, float width, float height, SimpleButtonColor color, bool isPressTap, string fontName) { _isPressTap = isPressTap; this.effectManager = Core.topEffectManager; _color = color; AddChild(button = new FSliceButton(width, height, _color.path, _color.path)); //button.SetPosition(0.25f,0.33f);//pixel perfect? AddChild(mainLabel = new DualLabel(fontName, title, Color.white, TOColors.TEXT_SHADOW)); mainLabel.y = 2.5f; if (_isPressTap) { button.SignalPress += (b) => DoTap(); } else { button.SignalRelease += (b) => DoTap(); } _overHighlight = new FSliceSprite("UI/ButtonHighlight", width, height, 12, 12, 12, 12); _overHighlight.alpha = 0.45f; ListenForUpdate(HandleUpdate); UpdateEnabled(); }
void HandleStartButtonClick(FSliceButton button) { if(areAllPlayersReady) { StartGame(); } else { } }
public override void Start() { FSoundManager.StopMusic(); FSprite logo = new FSprite("TetherLogo"); logo.y = 270.0f; AddChild(logo); // FLabel titleLabel = new FLabel("CubanoBig", "TETHER"); // AddChild(titleLabel); // titleLabel.y = 300; allReadyLabel = new FLabel("CubanoBig", ""); AddChild(allReadyLabel); allReadyLabel.y = 190; allReadyLabel.scale = 0.75f; if(GameManager.instance.shouldUseTeams) { FLabel teamLabel = new FLabel("Franchise", "TEAM MODE"); AddChild(teamLabel); teamLabel.y = -332; teamLabel.scale = 0.5f; teamLabel.alpha = 0.0f; Go.to(teamLabel, 0.5f, new TweenConfig().floatProp("alpha", 0.7f).setDelay(0.7f)); } // infoLabel = new FLabel("Franchise", "CLICK THE BOXES OR PRESS BACK/SELECT TO TOGGLE PLAYERS"); // AddChild(infoLabel); // infoLabel.y = -332; // infoLabel.scale = 0.5f; // infoLabel.alpha = 0.0f; // // Go.to(infoLabel, 0.5f, new TweenConfig().floatProp("alpha", 0.7f).setDelay(0.7f)); FLabel smallLabel; // smallLabel = new FLabel("Franchise", "F: FULLSCREEN"); AddChild(smallLabel); smallLabel.x = -634; smallLabel.y = 336.0f; smallLabel.alignment = FLabelAlignment.Left; smallLabel.scale = 0.4f; smallLabel.alpha = 0.7f; smallLabel = new FLabel("Franchise", "T: TOGGLE TEAMS"); AddChild(smallLabel); smallLabel.x = -634; smallLabel.y = 336.0f - 28.0f * 1; smallLabel.alignment = FLabelAlignment.Left; smallLabel.scale = 0.4f; smallLabel.alpha = 0.7f; // smallLabel = new FLabel("Franchise", "M: MUTE"); AddChild(smallLabel); smallLabel.x = -634; smallLabel.y = 336.0f - 28.0f * 2; smallLabel.alignment = FLabelAlignment.Left; smallLabel.scale = 0.4f; smallLabel.alpha = 0.7f; // smallLabel = new FLabel("Franchise", "R: RESET"); // AddChild(smallLabel); // smallLabel.x = -634; // smallLabel.y = 336.0f - 28.0f * 3; // smallLabel.alignment = FLabelAlignment.Left; // smallLabel.scale = 0.4f; // smallLabel.alpha = 0.7f; FSliceButton teamButton = new FSliceButton(140, 36, "Popup_BG", "Popup_BG", Color.white, Color.white, "click1"); AddChild(teamButton); teamButton.x = -Futile.screen.width/2 + 70; teamButton.y = Futile.screen.height/2 - 56; teamButton.sprite.alpha = 0.0f; //teamButton.AddLabelA("CubanoBig", "START!", 0.75f, 2f, Color.white); teamButton.SignalRelease += (b) => { TMain.instance.SwapTeams(); }; FSliceButton fullButton = new FSliceButton(140, 36, "Popup_BG", "Popup_BG", Color.white, Color.white, "click1"); AddChild(fullButton); fullButton.x = -Futile.screen.width/2 + 70; fullButton.y = Futile.screen.height/2 - 56 + 28.0f; fullButton.sprite.alpha = 0.0f; //teamButton.AddLabelA("CubanoBig", "START!", 0.75f, 2f, Color.white); fullButton.SignalRelease += (b) => { TMain.instance.SwapFullScreen(); }; startButton = new FSliceButton(220, 80, "Popup_BG", "Popup_BG", Color.blue, Color.white, "click1"); AddChild(startButton); startButton.x = 425.0f; startButton.y = 270; startButton.sprite.alpha = 0.3f; startButton.AddLabelA("CubanoBig", "START!", 0.75f, 2f, Color.white); startButton.SignalRelease += HandleStartButtonClick; startButton.alpha = 0.0f; float spreadX = 275; float spreadY = 115; AddChild(panelHolder = new FContainer()); panelHolder.y = -80.0f; List<Player> players = GameManager.instance.players; for(int p = 0; p<players.Count; p++) { Player player = players[p]; if(player.controller != GameManager.instance.unusedPlayerController && player.controller.CanBeUsed()) { AIPlayerController aiController = player.controller as AIPlayerController; if(aiController != null) { player.controller.SetPlayer(null); player.controller = aiController.symbolic; } } } selectedPanelBorder = new FContainer(); FSliceSprite selectBG = new FSliceSprite("Selection_BG", 540, 220, 16, 16, 16, 16); selectedPanelBorder.AddChild(selectBG); selectBG.alpha = 0.9f; selectBG.color = RXColor.GetColorFromHex(0xFF9966); AddChild(selectedPanelBorder); CreatePlayerPanel(0, -spreadX, spreadY); CreatePlayerPanel(1, spreadX, spreadY); CreatePlayerPanel(2, -spreadX, -spreadY); CreatePlayerPanel(3, spreadX, -spreadY); HandlePanelStateChange(); UpdateSelectedPanel(); ListenForUpdate (HandleUpdate); }