public StartMenu() { if (DogfighterMain.instance.musicOn && DogfighterMain.instance.titleMusic) { DogfighterMain.instance.titleMusic = false; FSoundManager.PlayMusic("Music/CiderTime", 0.25f); } //Create and show menu buttons title = new FSprite("MM_Title_1.png"); title.scale = 0.25f; title.y = 75.0f; AddChild(title); startButton = new FButton("MM_START.png", "MM_START_Selected.png"); startButton.scale = 0.5f; AddChild(startButton); optionsButton = new FButton("MM_OPTIONS.png", "MM_OPTIONS_Selected.png"); optionsButton.scale = 0.5f; optionsButton.y = -60.0f; AddChild(optionsButton); exitButton = new FButton("MM_EXIT.png", "MM_EXIT_Selected.png"); exitButton.scale = 0.5f; exitButton.y = -110.0f; AddChild(exitButton); //Adds listener to menu buttons that calls the associated function startButton.SignalRelease += StartButtonRelease; optionsButton.SignalRelease += OptionsButtonRelease; exitButton.SignalRelease += ExitButtonRelease; }
override public void Start() { background_ = new FSprite("level select screen final"); AddChild(background_); string highest_level = PlayerPrefs.GetString("highest_level"); if (highest_level.Equals("stomach")) { setBrain(ButtonType.locked); setLungs(ButtonType.locked); } else if (highest_level.Equals("lung")) { setBrain(ButtonType.locked); setLungs(ButtonType.normal); } else { setBrain(ButtonType.normal); setLungs(ButtonType.normal); } stomach = new FButton("Stomach", "StomachPressed"); stomach.SignalRelease += HandleStomachButton; AddChild(stomach); stomach.SetPosition(STOMACH_POSITION); background_.scale = 1f; Go.to(background_, 0.5f, new TweenConfig().setDelay(0.1f).floatProp("scale", 1.0f).setEaseType(EaseType.BackOut)); }
void InitButtons() { float verticalDivision = Futile.screen.height / 3f; whitButton = new FButton("whitNormal.png", "whitHover.png", "whitHappy.png", "plip"); danaButton = new FButton("danaNormal.png", "danaHover.png", "danaHappy.png", "plip"); whitButton.shouldReturnToUpElementAfterTouch = false; danaButton.shouldReturnToUpElementAfterTouch = false; whitButton.SignalRelease += PressedButton; danaButton.SignalRelease += PressedButton; whitButton.x = Futile.screen.halfWidth; whitButton.y = verticalDivision; danaButton.x = Futile.screen.halfWidth; danaButton.y = verticalDivision * 2f; whitButton.scale = 0.6f; danaButton.scale = 0.6f; AddChild(whitButton); AddChild(danaButton); }
// Use this for initialization public override void Start() { transitionIn = true; InitScript.inGame = false; background = new Starfield(InitScript.bg1Pos,false); Futile.stage.AddChild(background); background2 = new Starfield(InitScript.bg2Pos, false); Futile.stage.AddChild(background2); menuAnims = new FSprite("MenutoCredits0.png"); menuAnims.scale = 2.0f; menuAnims.x = 0; //menuAnims.isVisible = false; Futile.stage.AddChild(menuAnims); menuBackground = new FSprite("CreditScreen.png"); menuBackground.scale = 2.0f; menuBackground.x = 0; menuBackground.isVisible = false; Futile.stage.AddChild(menuBackground); btnInstructions = new FButton("MenuButton.png"); btnInstructions.x -= 1; btnInstructions.y -= 166; btnInstructions.scale = 2.0f; btnInstructions.isVisible = false; Futile.stage.AddChild(btnInstructions); InitScript.blackBar1.MoveToTop(); InitScript.blackBar2.MoveToTop(); btnInstructions.SignalRelease += HandleInfoButtonRelease; Futile.instance.SignalUpdate += HandleUpdate; }
public void handleLevelStart(FButton button) { if (button == levels.buttons["play1"]) { playGame(1); } else if (button == levels.buttons["play2"]) { playGame(2); } else if (button == levels.buttons["play3"]) { playGame(3); } else if (button == levels.buttons["play4"]) { playGame(4); } else if (button == levels.buttons["play5"]) { playGame(5); } else if (button == levels.buttons["play6"]) { playGame(6); } else if (button == levels.buttons["play7"]) { playGame(7); } else if (button == levels.buttons["play8"]) { playGame(8); } }
public void OnSignalPress(FButton button) { if (SignalPress != null) { SignalPress(this); } }
public void handleContinue(FButton button) { lake.RemoveFromContainer(); state = STATE_LEVELS; ScreenManager.loadScreen(levels, ScreenSourceDirection.Left); }
public override void Start() { background_ = new FSprite("level select screen final"); AddChild(background_); string highest_level = PlayerPrefs.GetString("highest_level"); if(highest_level.Equals("stomach")) { setBrain(ButtonType.locked); setLungs(ButtonType.locked); } else if(highest_level.Equals("lung")) { setBrain(ButtonType.locked); setLungs(ButtonType.normal); } else { setBrain(ButtonType.normal); setLungs(ButtonType.normal); } stomach = new FButton("Stomach", "StomachPressed"); stomach.SignalRelease += HandleStomachButton; AddChild(stomach); stomach.SetPosition(STOMACH_POSITION); background_.scale = 1f; Go.to(background_, 0.5f, new TweenConfig().setDelay(0.1f).floatProp("scale", 1.0f).setEaseType(EaseType.BackOut)); }
override public void Start() { _startButton = new FButton("boton"); _startButton.AddLabel("font", "Play!", new Color(0, 0, 20, 1f)); _startButton.scale = 2f; _titleLabel = new FLabel("font", "Super Futile Box"); _instLabel = new FLabel("font", "- Move with Arrow keys \n - Press 'space' to jump \n - Down key to fast fall \n - Avoid enemies!!! \n \n Tune: Barymag #2 - 8 by Lukasz Sychowicz (X-Ray)"); AddChild(_startButton); AddChild(_titleLabel); AddChild(_instLabel); _titleLabel.x = 0f; _titleLabel.y = 100f; _instLabel.x = 0f; _instLabel.y = -150f; _startButton.SignalRelease += HandleStartButtonRelease; _startButton.x = 0f; _startButton.y = 0f; Go.to(_startButton, 0.5f, new TweenConfig(). setDelay(0.3f). floatProp("scale", 1.0f). setEaseType(EaseType.BackOut)); }
private void Grid_Click(object sender, RoutedEventArgs e) { string val = value.Text; FButton btn = (FButton)e.Source; if (btn.Tag.ToString() == "Num") { if (val.Length < 18) { str.Append(btn.Content.ToString()); } } else if (btn.Tag.ToString() == "Ok") { if (sd != null) { sd(value.Text); } value.Text = ""; Hide(); } else if (btn.Tag.ToString() == "Delete") { if (val.Length > 0) { str.Remove(val.Length - 1, 1); } } value.Text = str.ToString(); }
public PlayerSelectPanel(Player player) { this.player = player; if(GameManager.instance.shouldUseTeams) { FSliceSprite teamBG = new FSliceSprite("Selection_BG", 528, 208, 16, 16, 16, 16); AddChild(teamBG); teamBG.alpha = 0.9f; teamBG.color = player.team.color; } AddChild(background = new FSliceSprite("Popup_BG",520,200,16,16,16,16)); background.color = player.color; background.alpha = 0.4f; AddChild(nameLabel = new FLabel("CubanoBig", player.name)); nameLabel.scale = 1.0f; nameLabel.y = 30.0f; AddChild(readyLabel = new FLabel("CubanoBig", "")); readyLabel.y = -30.0f; readyLabel.scale = 0.75f; AddChild(button = new FButton("Popup_BG")); button.sprite.width = 520; button.sprite.height = 200; button.alpha = 0.0f; //hidden button button.SignalPress += HandleSignalPress; ListenForUpdate(HandleUpdate); UpdateState(); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = (LinearLayout)inflater.Inflate(Resource.Layout.guessing_image_fragment, container, false); keyboardContainer = rootView.FindViewById <LinearLayout>(Resource.Id.keyboardContainer); solution = rootView.FindViewById <TextView>(Resource.Id.solution); clearAll = rootView.FindViewById <FButton>(Resource.Id.clearAll); delete = rootView.FindViewById <FButton>(Resource.Id.delete); slika = rootView.FindViewById <ImageView>(Resource.Id.image); slika.TransitionName = image.Name; if (!clearAll.HasOnClickListeners) { clearAll.Click += ClearAllClick; } if (!delete.HasOnClickListeners) { delete.Click += DeleteClick; } InitFields(); InitateKeyboard(); return(rootView); }
protected override void OnInitUI() { modelPopWnd1 = GetChild <FButton>("modelPopWnd1"); modelPopWnd2 = GetChild <FButton>("modelPopWnd2"); nonModelPopWnd = GetChild <FButton>("nonModelPopWnd"); closeAllBtn = GetChild <FButton>("closeAllBtn"); close100Btn = GetChild <FButton>("close100Btn"); modelPopWnd1.OnClick((context) => { ViewManager.GetInstance().Open <TestExampleWindowTest1Wnd>(); }); modelPopWnd2.OnClick((context) => { ViewManager.GetInstance().Open <TestExampleWindowTest2Wnd>(); }); nonModelPopWnd.OnClick((context) => { FView.Create <TestExampleWindowTest1Wnd>(this); }); closeAllBtn.OnClick((context) => { ViewManager.GetInstance().CloseAll(); }); close100Btn.OnClick((context) => { ViewManager.GetInstance().CloseLayer(100); }); }
public ExitConfirm() { //Create and show menu buttons title = new FLabel("FranchiseFont_Scale1", "QUIT?"); title.y = 100.0f; title.scaleX = 1.75f; title.scaleY = 1.75f; AddChild(title); mainMenuButton = new FButton("YellowButton_normal.png", "YellowButton_over.png"); mainMenuButton.AddLabel("FranchiseFont_Scale1", "NO", Color.white); mainMenuButton.x = -75.0f; mainMenuButton.y = -50.0f; AddChild(mainMenuButton); exitButton = new FButton("YellowButton_normal.png", "YellowButton_over.png"); exitButton.AddLabel("FranchiseFont_Scale1", "YES", Color.white); exitButton.x = 75.0f; exitButton.y = -50.0f; AddChild(exitButton); //Adds listener to menu buttons that calls the associated function mainMenuButton.SignalRelease += MainMenuButtonRelease; exitButton.SignalRelease += ExitButtonRelease; }
override public void Start() { _background = new FSprite("JungleBlurryBG"); AddChild(_background); //the banana container will make it easy to keep the bananas at the right depth _foodContainer = new FContainer(); AddChild(_foodContainer); List <string> foodList = new List <string>(); foodList.Add("Monkey_0"); for (int i = 0; i < 8; ++i) { foodList.Add("Banana"); } LayOutFood(foodList); //Clear out selected list BMain.instance.selected_foods.Clear(); _closeButton = new FButton("CloseButton_normal", "CloseButton_down", "CloseButton_over", "ClickSound"); AddChild(_closeButton); _closeButton.SignalRelease += HandleCloseButtonRelease; _scoreLabel = new FLabel("Franchise", "0 Bananas"); _scoreLabel.anchorX = 0.0f; _scoreLabel.anchorY = 1.0f; _scoreLabel.scale = 0.75f; _scoreLabel.color = new Color(1.0f, 0.90f, 0.0f); _timeLabel = new FLabel("Franchise", ((int)_secondsLeft) + " Seconds Left"); _timeLabel.anchorX = 1.0f; _timeLabel.anchorY = 1.0f; _timeLabel.scale = 0.75f; _timeLabel.color = new Color(1.0f, 1.0f, 1.0f); AddChild(_scoreLabel); AddChild(_timeLabel); _effectHolder = new FContainer(); AddChild(_effectHolder); _scoreLabel.alpha = 0.0f; Go.to(_scoreLabel, 0.5f, new TweenConfig(). setDelay(0.0f). floatProp("alpha", 1.0f)); _timeLabel.alpha = 0.0f; Go.to(_timeLabel, 0.5f, new TweenConfig(). setDelay(0.0f). floatProp("alpha", 1.0f). setEaseType(EaseType.BackOut)); _closeButton.scale = 0.0f; Go.to(_closeButton, 0.5f, new TweenConfig(). setDelay(0.0f). floatProp("scale", 1.0f). setEaseType(EaseType.BackOut)); HandleResize(true); //force resize to position everything at the start }
public void OnSignalReleaseOutside(FButton button) { if (SignalReleaseOutside != null) { SignalReleaseOutside(this); } }
public override void Start() { _startButton = new FButton("boton"); _startButton.AddLabel("font","Play!",new Color(0,0,20,1f)); _startButton.scale=2f; _titleLabel = new FLabel("font","Super Futile Box"); _instLabel = new FLabel("font","- Move with Arrow keys \n - Press 'space' to jump \n - Down key to fast fall \n - Avoid enemies!!! \n \n Tune: Barymag #2 - 8 by Lukasz Sychowicz (X-Ray)"); AddChild(_startButton); AddChild(_titleLabel); AddChild(_instLabel); _titleLabel.x = 0f; _titleLabel.y = 100f; _instLabel.x = 0f; _instLabel.y = -150f; _startButton.SignalRelease += HandleStartButtonRelease; _startButton.x = 0f; _startButton.y = 0f; Go.to(_startButton, 0.5f, new TweenConfig(). setDelay(0.3f). floatProp("scale",1.0f). setEaseType(EaseType.BackOut)); }
public override void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; FSprite background = new FSprite("viewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); string backButtonText = "Back"; string titleText = "About The Game"; if (Main.instance.gameFinished){ // Display end game messages titleText = "The Ship Went Nuclear!"; _scoreLabel = new FLabel("Emulogic", "You Saved " + Main.instance.crewSaved + " Crew Members"); _scoreLabel.color = Color.black; // new Color(0.173f, 0.722f, 0.976f, 1.0f); _scoreLabel.scale = 0.25f; _scoreLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight / 2); AddChild(_scoreLabel); _againButton = new FButton("buttonWide"); _againButton.AddLabel("Emulogic","Play Again",Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _againButton.label.scale = 0.25f; _againButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + 80); AddChild(_againButton); _againButton.SignalRelease += HandleAgainButtonRelease; backButtonText = "Home"; } else { // diplay generic message } _textLabel = new FLabel("Emulogic", titleText); _textLabel.color = Color.black; _textLabel.scale = 0.5f; _textLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight + Futile.screen.halfHeight * 2 / 3); AddChild(_textLabel); _quitButton = new FButton("buttonWide"); _quitButton.AddLabel("Emulogic",backButtonText,Color.black); //new Color(0.45f,0.25f,0.0f,1.0f) _quitButton.label.scale = 0.25f; _quitButton.SetPosition(Futile.screen.halfWidth, Futile.screen.halfHeight); AddChild(_quitButton); _quitButton.SignalRelease += HandleQuitButtonRelease; string about = "Game Designed and created by Jason Rendel,\nfor Ludum Dare 27. My first game jam ever!\nCreated for the 48 hour competition.\n\n ---- Tools ----\n Unity 3d - Futile - Gimp \nTexture Packer - Glyph Designer - CFXR\n\nFollow me @jasonrendel\nCheck out what else I'm up to at www.jasonrendel.com"; _scoreLabel = new FLabel("Emulogic", about); _scoreLabel.color = Color.black; _scoreLabel.scale = 0.20f; _scoreLabel.SetPosition(Futile.screen.halfWidth, 200); AddChild(_scoreLabel); }
public void HandleShoot(FButton button) { _shot = new Shot(); _shot.x = _holder.x + 10; _shot.y = _holder.y; Futile.stage.AddChild(_shot); _shots.Add(_shot); }
private void moreAsteroids(FButton button) { if (asteroidSpawnRate > 1) { spawnAsteroids = true; asteroidSpawnRate--; } }
protected override void OnInitUI() { btn1 = GetChild <FButton>("btn1"); btn1.OnClick((context) => { Close(); }); }
protected override void OnInitUI() { closeBtn = GetChild <FButton>("closeBtn"); closeBtn.OnClick((context) => { Close(); }); }
protected override void OnInitUI() { btn1 = GetChild <FButton>("btn1"); btn1.OnClick((context) => { btn1.SetText("被点击了"); }); }
private void HandleButtonClick(FButton button) { if(stat.CanBuy()) { FSoundManager.PlaySound("LevelUp",1.0f); stat.Buy(); } }
private void Answer_Click(object sender, EventArgs e) { TransitionManager.BeginDelayedTransition((ViewGroup)rootView, new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn)); FButton btn = sender as FButton; if (btn.Text.Equals(correctAnswer.ToString())) { numberOfCorrectAnswers++; int colorFrom = Resources.GetColor(Resource.Color.transparent); int colorTo = Resources.GetColor(Resource.Color.fbutton_color_green_sea); ValueAnimator colorAnim = ObjectAnimator.OfInt(questionLayout, "backgroundColor", (int)colorFrom, (int)colorTo); colorAnim.SetDuration(500); colorAnim.SetEvaluator(new ArgbEvaluator()); colorAnim.RepeatCount = 1; colorAnim.RepeatMode = ValueAnimatorRepeatMode.Reverse; colorAnim.Start(); } else { int colorFrom = Resources.GetColor(Resource.Color.transparent); int colorTo = Resources.GetColor(Android.Resource.Color.HoloRedDark); ValueAnimator colorAnim = ObjectAnimator.OfInt(questionLayout, "backgroundColor", (int)colorFrom, (int)colorTo); colorAnim.SetDuration(500); colorAnim.SetEvaluator(new ArgbEvaluator()); colorAnim.RepeatCount = 1; colorAnim.RepeatMode = ValueAnimatorRepeatMode.Reverse; colorAnim.Start(); } if (question == 10) { timer.Stop(); startLayout.Visibility = ViewStates.Visible; igrajPonovoLayout.Visibility = ViewStates.Visible; brojTacnihNaKraju.Text = numberOfCorrectAnswers.ToString(); vremeNaKraju.Text = vremeResavanja.ToString(); CRecord record = new CRecord(); record.GameId = App.MathWithAnswersCode + (int)operacija; record.Result = numberOfCorrectAnswers; record.Time = vremeResavanja; App.db.InsertRecord(record); return; } SetValues(); question++; redniBrojZadatka.Text = question.ToString(); tacnihOdgovoraTW.Text = numberOfCorrectAnswers.ToString(); }
public Tweener NewButton(float x, float y, string fontName, string text, string bgName) { var n = new FButton(bgName); //n.sprite.isVisible = false; n.AddLabel(fontName, text, Color.white); n.sprite.scaleX = n.label.textRect.width/n.sprite.textureRect.width; n.sprite.scaleY = n.label.textRect.height/n.sprite.textureRect.height; return NewTweener(n, x, y); }
// Use this for initialization public override void Start() { transitionIn = InitScript.shouldPlayMenuTransition; InitScript.inGame = false; background = new Starfield(InitScript.bg1Pos,false); Futile.stage.AddChild(background); background2 = new Starfield(InitScript.bg2Pos, false); Futile.stage.AddChild(background2); menuBackground = new FSprite("MenuStatic.png"); menuBackground.scale = 2.0f; menuBackground.x = 0; if (InitScript.shouldPlayMenuTransition == true) menuBackground.isVisible = false; Futile.stage.AddChild(menuBackground); menuAnims = new FSprite("Menutoplay6.png"); if (InitScript.shouldPlayMenuTransition == false) menuAnims.SetElementByName("MenuAnim0.png"); menuAnims.scale = 2.0f; menuAnims.x = 0; //menuAnims.isVisible = false; Futile.stage.AddChild(menuAnims); btnInstructions = new FButton("InfoButton.png"); btnInstructions.x -= 1; btnInstructions.y -= 126; btnInstructions.scale = 2.0f; if (InitScript.shouldPlayMenuTransition == true) btnInstructions.isVisible = false; Futile.stage.AddChild(btnInstructions); btnCredits = new FButton("CreditsButton.png"); btnCredits.x -= 1; btnCredits.y -= 166; btnCredits.scale = 2.0f; if (InitScript.shouldPlayMenuTransition == true) btnCredits.isVisible = false; Futile.stage.AddChild(btnCredits); btnPlay = new FButton("PlayButton.png"); btnPlay.x = 0; btnPlay.y = 0; btnPlay.scale = 2.0f; Futile.stage.AddChild(btnPlay); InitScript.blackBar1.MoveToTop(); InitScript.blackBar2.MoveToTop(); btnInstructions.SignalRelease += HandleInfoButtonRelease; btnCredits.SignalRelease += HandleCreditButtonRelease; btnPlay.SignalRelease += HandlePlayButtonRelease; Futile.instance.SignalUpdate += HandleUpdate; }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = (FrameLayout)inflater.Inflate(Resource.Layout.math_fragment, container, false); TransitionManager.BeginDelayedTransition((ViewGroup)rootView, new ChangeText().SetChangeBehavior(ChangeText.ChangeBehaviorOutIn)); igrajPonovo = rootView.FindViewById <FButton>(Resource.Id.igrajPonovo); izlaz = rootView.FindViewById <FButton>(Resource.Id.izlaz); number1Btn = rootView.FindViewById <FButton>(Resource.Id.number1); number2Btn = rootView.FindViewById <FButton>(Resource.Id.number2); number3Btn = rootView.FindViewById <FButton>(Resource.Id.number3); number4Btn = rootView.FindViewById <FButton>(Resource.Id.number4); number5Btn = rootView.FindViewById <FButton>(Resource.Id.number5); number6Btn = rootView.FindViewById <FButton>(Resource.Id.number6); number7Btn = rootView.FindViewById <FButton>(Resource.Id.number7); number8Btn = rootView.FindViewById <FButton>(Resource.Id.number8); number9Btn = rootView.FindViewById <FButton>(Resource.Id.number9); number0Btn = rootView.FindViewById <FButton>(Resource.Id.number0); delete = rootView.FindViewById <FButton>(Resource.Id.delete); start = rootView.FindViewById <FButton>(Resource.Id.start); startLayout = rootView.FindViewById <LinearLayout>(Resource.Id.startLayout); number1TW = rootView.FindViewById <TextView>(Resource.Id.number1TW); number2TW = rootView.FindViewById <TextView>(Resource.Id.number2TW); solutionTW = rootView.FindViewById <TextView>(Resource.Id.solutionTW); vreme = rootView.FindViewById <TextView>(Resource.Id.vreme); redniBrojZadatka = rootView.FindViewById <TextView>(Resource.Id.redniBrojZadatka); operacijaTW = rootView.FindViewById <TextView>(Resource.Id.operacija); tacnihOdgovoraTW = rootView.FindViewById <TextView>(Resource.Id.tacnihOdgovora); brojTacnihNaKraju = rootView.FindViewById <TextView>(Resource.Id.brojTacnihNaKraju); vremeNaKraju = rootView.FindViewById <TextView>(Resource.Id.vremeNaKraju); igrajPonovoLayout = rootView.FindViewById <LinearLayout>(Resource.Id.igrajPonovoLayout); questionLayout = rootView.FindViewById <LinearLayout>(Resource.Id.questionLayout); Init(); start.Click += delegate { Start(); }; izlaz.Click += delegate { //Activity.FragmentManager.PopBackStack(); PlayFragment pf = new PlayFragment(); Activity.FragmentManager.BeginTransaction().Replace(App.fragmentContainer.Id, pf, "play").Commit(); App.CurrentFragment = pf; }; igrajPonovo.Click += delegate { Start(); }; return(rootView); }
private void HandleScrollButtonRelease(FButton button) { Debug.Log ("SCROLL BUTTON CLICK"); FPseudoHtmlText text=new FPseudoHtmlText(Config.fontFile,"<style text-color='#111111'>Click!</style>",Config.textParams,100f,PseudoHtmlTextAlign.center,1f,this); FSpeechBubble bubble=FSpeechBubbleManager.Instance.Show(text,text.width,text.height,FSpeechBubbleManager.Instance.defaultContentMarginX,FSpeechBubbleManager.Instance.defaultContentMarginY,button.LocalToGlobal(Vector2.zero),FSpeechBubbleManager.Instance.defaultPointerLength,10f,FSpeechBubbleManager.Instance.defaultBackgroundColor,this,FSpeechBubbleManager.Instance.defaultVisibleArea); FSpeechBubbleManager.TransitionPop(bubble); FSpeechBubbleManager.TransitionFadeOut(bubble,1f); }
private void attackButton_SignalRelease(FButton b) { Debug.Log("Attack button clicked."); if (this.selectedActor != null) { this.highlightLocalAttackable(); this.selectedActor.TurnState = ActorState.SelectingEnemy; this.RemoveChild(this.buttonStrip); } }
private void waitButton_SignalRelease(FButton b) { Debug.Log("Wait button clicked."); if (this.selectedActor != null) { this.selectedActor.TurnState = ActorState.TurnOver; this.clearSelection(); this.RemoveChild(this.buttonStrip); } }
FButton addButton(string name) { FButton button = new FButton(Futile.whiteElement.name); button.AddLabel("Abstract", name, tone1); button.sprite.alpha = 0; button.scale *= 2.5f; menuElements.Add(button); return(button); }
override public void Start() { BMain.instance.score = 0; _background = new FSprite("JungleBlurryBG.png"); AddChild(_background); //the banana container will make it easy to keep the bananas at the right depth _bananaContainer = new FContainer(); AddChild(_bananaContainer); _closeButton = new FButton("CloseButton_normal.png", "CloseButton_over.png", "ClickSound"); AddChild(_closeButton); _closeButton.SignalRelease += HandleCloseButtonRelease; _scoreLabel = new FLabel("Franchise", "0 Bananas"); _scoreLabel.anchorX = 0.0f; _scoreLabel.anchorY = 1.0f; _scoreLabel.scale = 0.75f; _scoreLabel.color = new Color(1.0f, 0.90f, 0.0f); _timeLabel = new FLabel("Franchise", ((int)_secondsLeft) + " Seconds Left"); _timeLabel.anchorX = 1.0f; _timeLabel.anchorY = 1.0f; _timeLabel.scale = 0.75f; _timeLabel.color = new Color(1.0f, 1.0f, 1.0f); AddChild(_scoreLabel); AddChild(_timeLabel); _effectHolder = new FContainer(); AddChild(_effectHolder); _scoreLabel.alpha = 0.0f; Go.to(_scoreLabel, 0.5f, new TweenConfig(). setDelay(0.0f). floatProp("alpha", 1.0f)); _timeLabel.alpha = 0.0f; Go.to(_timeLabel, 0.5f, new TweenConfig(). setDelay(0.0f). floatProp("alpha", 1.0f). setEaseType(EaseType.BackOut)); _closeButton.scale = 0.0f; Go.to(_closeButton, 0.5f, new TweenConfig(). setDelay(0.0f). floatProp("scale", 1.0f). setEaseType(EaseType.BackOut)); HandleResize(true); //force resize to position everything at the start }
private void lessAsteroids(FButton button) { if (asteroidSpawnRate < 7) { asteroidSpawnRate++; } else { spawnAsteroids = false; } }
public MainMenuPage() { gameLogo = new FSprite("Futile_White"); Play = new FButton("Futile_White", "Futile_White"); title = new FLabel("font", ""); message = new FLabel("font", "press Enter to begin adventure"); Play.SignalRelease += PlayRelease; ListenForUpdate(Update); }
// Обновление уровня технологии public void UpdateTech(ShipType AShipType, ShipTech ATechID) { // Обновление кнопки технологии foreach (MonoUIObjectTechShipBuy FButton in FButtons) { if (FButton.CheckUpdate((ShipType)AShipType, (ShipTech)ATechID)) { return; } } }
// when an arrow is pressed and released, shift a column up/down or a row right/left public void ArrowButtonReleased(FButton button) { ArrowData arrowData = (ArrowData)button.data; if (arrowData.direction == Direction.Up || arrowData.direction == Direction.Down) { ShiftColumnInDirection(arrowData.index, arrowData.direction); } else if (arrowData.direction == Direction.Right || arrowData.direction == Direction.Left) { ShiftRowInDirection(arrowData.index, arrowData.direction); } }
private void abilityButtonPressed(FButton b) { Debug.Log("[[Ability Button Pressed]]: Actor " + this.SelectedActor + ", Ability " + b.data); var ability = b.data as Ability; var controller = ability.GetController(); controller.ActionComplete += actionComplete; this.mapContainer.RemoveChild(this.buttonStrip); this.buttonStrip = null; this.SelectedActor.TurnState = ActorState.ExecutingCommand; controller.Activate(ability); }
override public void Start() { // once play navigates away from home screen, don't play the intro when they return Main.instance.playIntro = false; Main.instance.crewSaved = 0; FSprite background = new FSprite("mainGameViewport"); background.SetAnchor(0.0f, 0.0f); AddChild(background); _levelManager = new LevelManager(); AddChild(_levelManager); this.shouldSortByZ = true; meltdownBar = new FSprite("meltdown"); meltdownBar.SetPosition(Futile.screen.halfWidth, 672); AddChild(meltdownBar); _closeButton = new FButton("button"); _closeButton.AddLabel("Emulogic", "Quit", Color.black); _closeButton.label.scale = 0.25f; _closeButton.sortZ = 1; _closeButton.SignalRelease += HandleCloseButtonRelease; _closeButton.x = Futile.screen.width - 125.0f; _closeButton.y = Futile.screen.height - 75.0f; AddChild(_closeButton); Clock clock = new Clock(); clock.SetPosition(75.0f, Futile.screen.height - 75.0f); AddChild(clock); crewSavedLabel = new FLabel("Emulogic", "Crew Members Saved: 0"); crewSavedLabel.SetPosition(Futile.screen.halfWidth, Futile.screen.height - 45.0f); crewSavedLabel.scale = 0.25f; AddChild(crewSavedLabel); selectedInventory = new FSprite("inventorySelected"); selectedInventory.isVisible = false; AddChild(selectedInventory); //spawnInventory(); spawnCrew(2); _lastCycle = Main.GameTime; }
protected override void OnInitUI() { containerBtn = GetChild <FButton>("containerBtn"); containerComp = GetChild <TestContainerComp>("containerComp"); containerBtn.OnClick((context) => { containerComp.SetVisible(!containerComp.IsVisible()); }); containerComp.DebugUI(); }
public TitlePage() { _title = new FLabel("gamefont", "Xelda Prototype"); _title.y = 200; _title.scale = 2f; AddChild(_title); _start = new FButton("start_up.png","start_down.png"); _start.AddLabel("gamefont","Start", Color.white); AddChild(_start); _start.SignalRelease += HandleManButtonPressed; }
private void btnNo_Click(object sender, EventArgs e) { if (this.btnNo.Visible) { FButton button = sender as FButton; this.DialogResult = (button.Text.Trim() == "是") ? DialogResult.Yes : DialogResult.No; } else { this.DialogResult = DialogResult.OK; } this.Close(); }
// Use this for initialization public void Start() { _isEnabled = false; isVisible = false; _banana = new FSprite("Banana"); _banana.y = 75; AddChild(_banana); //FBomb Buttons //FBomb types: //Standard (can press any key) //Reverse (must type 'KCUF') //Dvorak (must type 'YFIV') _b0 = new FButton("CloseButton_normal", "CloseButton_down", "CloseButton_over", "ClickSound"); _b0.x = LEFT_EDGE/2; _b1 = new FButton("CloseButton_normal", "CloseButton_down", "CloseButton_over", "ClickSound"); _b2 = new FButton("CloseButton_normal", "CloseButton_down", "CloseButton_over", "ClickSound"); _b2.x = RIGHT_EDGE/2; _b0.y = _b1.y = _b2.y = -30; _b0.SignalPress += HandleMash; _b1.SignalPress += HandleReverse; _b2.SignalPress += HandleDvorak; AddChild(_b0); AddChild(_b1); AddChild(_b2); //Upgrade Buttons _b3 = new FButton("CloseButton_normal", "CloseButton_down", "CloseButton_over", "ClickSound"); _b3.x = LEFT_EDGE/2; _b4 = new FButton("CloseButton_normal", "CloseButton_down", "CloseButton_over", "ClickSound"); _b5 = new FButton("CloseButton_normal", "CloseButton_down", "CloseButton_over", "ClickSound"); _b5.x = RIGHT_EDGE/2; _b3.rotation = _b4.rotation = _b5.rotation = 45; _b3.y = _b4.y = _b5.y = -100; _b3.SignalPress += Conductor; _b4.SignalPress += Parts; _b5.SignalPress += Rails; AddChild(_b3); AddChild(_b4); AddChild(_b5); }
public override void Start() { _back=new FButton("Futile_White","Futile_White",null,null); _back.SetColors(new Color(0f,0f,1f),new Color(0f,0f,0.5f)); _back.AddLabel(Config.fontFile,"Next",Color.white); _back.scaleX=6f; _back.label.scaleX=0.5f/_back.scaleX; _back.scaleY=2f; _back.label.scaleY=0.5f/_back.scaleY; _back.x=Futile.screen.halfWidth-_back.hitRect.width*_back.scaleX*0.5f; _back.y=-Futile.screen.halfHeight+_back.hitRect.height*_back.scaleY*0.5f; Futile.stage.AddChild(_back); _back.SignalRelease+=HandleNextButtonRelease; }
public override void Start() { _background = new FSprite("Background.png"); AddChild(_background); _againButton = new FButton("CircleButtonBG_normal.png", "CircleButtonBG_over.png", "Click"); _againButton.AddLabel("Cubano","AGAIN!",Color.white); AddChild (_againButton); _againButton.x = -Futile.screen.halfWidth+100; _againButton.y = Futile.screen.halfHeight-100; _againButton.SignalRelease += HandleStartButtonRelease; this.alpha = 0.0f; Go.to (this, 0.5f, new TweenConfig().floatProp("alpha",1.0f)); }
public OptionsPage() { FSprite bg = new FSprite("Futile_White"); bg.width = Futile.screen.width; bg.height = Futile.screen.height; bg.color = Color.gray; bg.x = Futile.screen.width / 2; bg.y = Futile.screen.height / 2; AddChild(bg); // Labels moonwalkLabel = new FLabel("font","Moon walk"); lefthandedLabel = new FLabel("font","Left handed controls"); screenshakeLabel = new FLabel("font","Screenshake intensity"); controlsScale = new FLabel("font", "Controls scale"); moonwalkLabel.alignment = FLabelAlignment.Left; lefthandedLabel.alignment = FLabelAlignment.Left; screenshakeLabel.alignment = FLabelAlignment.Left; controlsScale.alignment = FLabelAlignment.Left; SaveAndReturn = new FButton("Futile_White", "Futile_White"); SaveAndReturn.SignalRelease += SaveAndReturnSignal; // Buttons and probs the slider for screenshake? moonwalkButton = new FButton("radioOn"); moonwalkButton.expansionAmount = 40f; if(GameConfig.isMoonWalkingActive) moonwalkButton.SetElements("radioOn", "radioOn", "radioOn"); else moonwalkButton.SetElements("radioOff", "radioOff", "radioOff"); moonwalkButton.SignalRelease += HandleMoonWalkButton; lefthandedButton = new FButton("radioOn"); lefthandedButton.expansionAmount = 40f; if(GameConfig.isLeftHandedActive) lefthandedButton.SetElements("radioOn", "radioOn","radioOn"); else lefthandedButton.SetElements("radioOff", "radioOff", "radioOff"); lefthandedButton.SignalRelease += HandleLeftiesButton; shakeSlider = new RSlider("sliderBar", "sliderIndicator", GameConfig.screenShakeIntensity); scaleSlider = new RSlider("sliderBar", "sliderIndicator", GameConfig.virtualControlsSize); }
public override void HandleRemovedFromStage() { Futile.instance.SignalUpdate -= HandleUpdate; Futile.screen.SignalResize -= HandleResize; Futile.touchManager.RemoveSingleTouchTarget( this ); closeButton.SignalRelease -= onCloseClicked; RemoveChild( closeButton ); closeButton = null; RemoveChild( background ); background = null; purge(); base.HandleRemovedFromStage(); }
public override void Start() { // Access immunity menu immunityMenu = GameObject.Find ("Futile").GetComponent<ImmunityMenu>(); // Sound FSoundManager.StopMusic(); FSoundManager.UnloadAllSoundsAndMusic(); FSoundManager.PlayMusic("background_music"); FSoundManager.PreloadSound("button_click"); // GUI objects background_ = new FSprite("start screen final"); play_button = new FButton("Play","PlayPressed"); how_to_play_button = new FButton("how_to_play", "how_to_play_pressed"); credits_button = new FButton("Credits", "CreditsPressed"); // Add objects to stage AddChild(background_); AddChild(play_button); AddChild(how_to_play_button); AddChild(credits_button); // Scale and set position background_.scale = 0.0f; play_button.scale = .6f; play_button.x = Futile.screen.halfWidth*.3f; play_button.y = Futile.screen.halfHeight*.1f; how_to_play_button.x = Futile.screen.halfWidth*.45f; how_to_play_button.y = Futile.screen.halfHeight*-.3f; credits_button.scale = .6f; credits_button.x = Futile.screen.halfWidth*.35f; credits_button.y = Futile.screen.halfHeight*-.7f; // Set button delegates play_button.SignalRelease += HandlePlayButton; how_to_play_button.SignalRelease += HandleHowToPlayButton; credits_button.SignalRelease += HandleCreditsButton; Go.to(background_, 0.5f, new TweenConfig().setDelay(0.1f).floatProp("scale", 1.0f).setEaseType(EaseType.BackOut)); }
public override void HandleAddedToStage() { base.HandleAddedToStage(); Futile.touchManager.AddSingleTouchTarget( this ); background = new FSprite( "blank" ); background.color = Color.white; AddChild( background ); build(); closeButton = new FButton( "CloseButton_normal", "CloseButton_down", "CloseButton_over" ); closeButton.SignalRelease += onCloseClicked; AddChild( closeButton ); Futile.instance.SignalUpdate += HandleUpdate; Futile.screen.SignalResize += HandleResize; HandleResize( false ); }
public MStatView(MPlayerStat stat) { this.stat = stat; stat.SignalChange += HandleStatChange; AddChild(_title = new FLabel("Cubano", "")); _title.anchorY = 0.0f; _title.y = 27.0f; _title.scale = 0.4f; AddChild(_button = new FButton("SquareButtonBG_normal.png", "SquareButtonBG_over.png","Click")); _button.AddLabel("Cubano", "", Color.white); _button.label.text = ""; _button.label.scale = 0.75f; _button.isEnabled = false; _button.SignalRelease += HandleButtonClick; HandleStatChange (stat); }
override public void Start() { _background = new FSprite("JungleClearBG"); AddChild(_background); //this will scale the background up to fit the screen //but it won't let it shrink smaller than 100% _logoHolder = new FContainer(); AddChild (_logoHolder); _logo = new FSprite("MainLogo"); _logoHolder.AddChild(_logo); _startButton = new FButton("YellowButton_normal", "YellowButton_down", "YellowButton_over", "ClickSound"); _startButton.AddLabel("Franchise","START",new Color(0.45f,0.25f,0.0f,1.0f)); AddChild(_startButton); _startButton.SignalRelease += HandleStartButtonRelease; _logoHolder.scale = 0.0f; Go.to(_logoHolder, 0.5f, new TweenConfig(). setDelay(0.1f). floatProp("scale",1.0f). setEaseType(EaseType.BackOut)); _startButton.scale = 0.0f; Go.to(_startButton, 0.5f, new TweenConfig(). setDelay(0.3f). floatProp("scale",1.0f). setEaseType(EaseType.BackOut)); HandleResize(true); //force resize to position everything at the start }
public override void Start() { ShowTitle("Fractals fun\nClick to set random params"); newOne(); base.Start(); FButton button=new FButton("Futile_White","Futile_White",null,null); button.SetColors(new Color(0f,0f,1f),new Color(0f,0f,0.5f)); button.AddLabel(Config.fontFile,"New tree",Color.white); button.scaleX=8f; button.label.scaleX=0.5f/button.scaleX; button.scaleY=2f; button.label.scaleY=0.5f/button.scaleY; button.x=Futile.screen.halfWidth-button.hitRect.width*button.scaleX*0.5f; button.y=Futile.screen.halfHeight-button.hitRect.height*button.scaleY*0.5f; Futile.stage.AddChild(button); button.SignalRelease+=HandleNewButtonRelease; }
public void build() { Futile.touchManager.AddSingleTouchTarget( this ); background = new FSprite( "blank" ); background.color = Color.white; AddChild( background ); bunnyButton = new FButton( "YellowButton_normal", "YellowButton_down", "YellowButton_over" ); bunnyButton.AddLabel( "Franchise", "TEST 1", Color.white ); bunnyButton.SignalRelease += onBunnyClicked; AddChild( bunnyButton ); benchButton = new FButton( "YellowButton_normal", "YellowButton_down", "YellowButton_over" ); benchButton.AddLabel( "Franchise", "TEST 2", Color.white ); benchButton.SignalRelease += onBenchClicked; AddChild( benchButton ); pirateButton = new FButton( "YellowButton_normal", "YellowButton_down", "YellowButton_over" ); pirateButton.AddLabel( "Franchise", "TEST 3", Color.white ); pirateButton.SignalRelease += onPirateClicked; AddChild( pirateButton ); }
public override void Start() { _background = new FSprite("Background.png"); AddChild(_background); _logo = new FSprite("TitleLogo.png"); _logo.x += 10; _logo.y -= 10; AddChild(_logo); _startButton = new FButton("CircleButtonBG_normal.png", "CircleButtonBG_over.png", "Click"); _startButton.AddLabel("Cubano","START!",Color.white); _startButton.x = 0; _startButton.y = -150.0f; AddChild(_startButton); _startButton.SignalRelease += HandleStartButtonRelease; this.alpha = 0.0f; Go.to (this, 0.5f, new TweenConfig().floatProp("alpha",1.0f)); }
public override void Start() { _background = new FSprite("JungleBlurryBG.png"); AddChild(_background); //this will scale the background up to fit the screen //but it won't let it shrink smaller than 100% _monkey = new BMonkey(); AddChild(_monkey); _monkey.x = -5.0f; _monkey.y = -2.0f; _againButton = new FButton("YellowButton_normal.png", "YellowButton_over.png", "ClickSound"); _againButton.AddLabel("Franchise","AGAIN?",new Color(0.45f,0.25f,0.0f,1.0f)); AddChild(_againButton); _againButton.y = -110.0f; _againButton.SignalRelease += HandleAgainButtonRelease; _scoreLabel = new FLabel("Franchise", BMain.instance.score+" Bananas"); AddChild(_scoreLabel); _scoreLabel.color = new Color(1.0f,0.9f,0.2f); _scoreLabel.y = 110.0f; if(BMain.instance.score > BMain.instance.bestScore) { BMain.instance.bestScore = BMain.instance.score; _isNewBestScore = true; } else { _isNewBestScore = false; } _bestScoreLabel = new FLabel("Franchise", "Best score: " + BMain.instance.bestScore+" Bananas"); AddChild(_bestScoreLabel); _bestScoreLabel.scale = 0.5f; _bestScoreLabel.anchorX = 1.0f; _bestScoreLabel.anchorY = 0.0f; _bestScoreLabel.color = new Color(1.0f,0.9f,0.2f); _scoreLabel.scale = 0.0f; Go.to(_scoreLabel, 0.5f, new TweenConfig(). setDelay(0.3f). floatProp("scale",1.0f). setEaseType(EaseType.BackOut)); _monkey.scale = 0.0f; Go.to(_monkey, 0.5f, new TweenConfig(). setDelay(0.1f). floatProp("scale",1.0f). setEaseType(EaseType.BackOut)); _againButton.scale = 0.0f; Go.to(_againButton, 0.5f, new TweenConfig(). setDelay(0.3f). floatProp("scale",1.0f). setEaseType(EaseType.BackOut)); HandleResize(true); //force resize to position everything at the start }
private void HandleAgainButtonRelease(FButton button) { BSoundPlayer.PlayRegularMusic(); BMain.instance.GoToPage(BPageType.InGamePage); }
protected void HandleNewButtonRelease(FButton b) { newOne(); }
private void HandleNextButtonRelease(FButton button) { //Debug.Log ("HandleNextButtonRelease"); int i=0; for (;i<testPages.Count;i++) { if (Main.instance.currentPageType==testPages[i]) { break; } } i++; if (i>=testPages.Count) i=0; //show next test page Main.instance.FadeToPage(testPages[i]); }
private void setBrain(ButtonType type) { if(brain != null){ RemoveChild(brain); } switch(type){ case ButtonType.normal: brain = new FButton("Brain", "BrainPressed"); brain.SignalRelease += HandleBrainButton; break; case ButtonType.locked: brain = new FButton("BrainLocked"); break; } AddChild(brain); brain.SetPosition(BRAIN_POSITION); }