当前位置: 首页>>代码示例>>C#>>正文


C# FButton类代码示例

本文整理汇总了C#中FButton的典型用法代码示例。如果您正苦于以下问题:C# FButton类的具体用法?C# FButton怎么用?C# FButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FButton类属于命名空间,在下文中一共展示了FButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

    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));
    }
开发者ID:rhololkeolke,项目名称:Game-Design-Class,代码行数:27,代码来源:LevelSelectPage.cs

示例2: Start

    // 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;
    }
开发者ID:adnissen,项目名称:Irrupt,代码行数:36,代码来源:CreditsPage.cs

示例3: PlayerSelectPanel

    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();
    }
开发者ID:hassanLastborn,项目名称:Tether,代码行数:34,代码来源:PlayerSelectPanel.cs

示例4: Start

    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));
    }
开发者ID:riktothepast,项目名称:SuperFutileBox,代码行数:27,代码来源:MenuPage.cs

示例5: Start

    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);
    }
开发者ID:jrendel,项目名称:LD27,代码行数:59,代码来源:ScoreScreen.cs

示例6: HandleButtonClick

 private void HandleButtonClick(FButton button)
 {
     if(stat.CanBuy())
     {
         FSoundManager.PlaySound("LevelUp",1.0f);
         stat.Buy();
     }
 }
开发者ID:MattRix,项目名称:Madness,代码行数:8,代码来源:MStatView.cs

示例7: HandleShoot

 public void HandleShoot(FButton button)
 {
     _shot = new Shot();
     _shot.x = _holder.x + 10;
     _shot.y = _holder.y;
     Futile.stage.AddChild(_shot);
     _shots.Add(_shot);
 }
开发者ID:ktn,项目名称:KevinEnemyPractice,代码行数:8,代码来源:Gamepage.cs

示例8: HandleScrollButtonRelease

    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);
    }
开发者ID:tanis2000,项目名称:Futile,代码行数:9,代码来源:PageTestScrollContainer.cs

示例9: Start

    // 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;
    }
开发者ID:adnissen,项目名称:Irrupt,代码行数:58,代码来源:MenuPage.cs

示例10: NewButton

 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);
 }
开发者ID:TheJare,项目名称:UnityUtils,代码行数:9,代码来源:Scene.cs

示例11: MainMenuPage

    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);
    }
开发者ID:riktothepast,项目名称:LD30,代码行数:11,代码来源:MainMenuPage.cs

示例12: ArrowButtonReleased

    // 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);
        }
    }
开发者ID:soshimozi,项目名称:Match-Puzzle-Shapes-Using-Bitmasks,代码行数:13,代码来源:BitmaskPuzzleGame.cs

示例13: TitlePage

    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;
    }
开发者ID:poemdexter,项目名称:Xelda-Unity,代码行数:13,代码来源:TitlePage.cs

示例14: Start

    // 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);
    }
开发者ID:pcasao3,项目名称:Fukyo,代码行数:51,代码来源:FuckMenu.cs

示例15: Start

    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;
    }
开发者ID:tanis2000,项目名称:Futile,代码行数:16,代码来源:PageTest.cs


注:本文中的FButton类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。