Example #1
0
    //-------------------------------------------------------------------------
    //						  METHOD DEFINITIONS
    //-------------------------------------------------------------------------
    void Awake()
    {
        // scale and position start and exit button

        StartButton.SetScale(0.5f);

        float w = StartButton.GetWidth();
        float x = (Screen.width - w - 120);
        float y = Screen.height / 3.0f;

        StartButton.SetPosition(new Vector2(x, y));

        ExitButton.SetScale(0.5f);
        w = ExitButton.GetWidth();
        float h = ExitButton.GetHeight();

        x  = (Screen.width - w - 120);
        y += h;

        ExitButton.SetPosition(new Vector2(x, y));

        // set the fader for the buttons
        buttonFader_ = new Fader(0.0f, 2.0f, 0.5f);
        backgFader_  = new Fader(0.0f, 5.0f, 5.0f);
        musicFader_  = new Fader(0.0f, 3.0f, 3.0f);

        // set buttons unclickable in the beginning
        StartButton.SetIsClickable(false);
        ExitButton.SetIsClickable(false);
    }
    //-------------------------------------------------------------------------
    //						CLASS METHOD DEFINITIONS
    //-------------------------------------------------------------------------
    void Awake()
    {
        // position the again button
        AgainButton.SetScale(0.25f);
        ExitButton.SetScale(0.25f);

        float off = 50;

        Vector2 pos = new Vector2();

        pos.x = Screen.width / 2.0f - (AgainButton.GetWidth() + ExitButton.GetWidth() + 50) / 2.0f;
        pos.y = 40.0f;

        AgainButton.SetPosition(pos);

        // position the exit button

        pos.x = Screen.width / 2.0f + (ExitButton.GetWidth()) / 2.0f;
        pos.y = 40.0f;

        ExitButton.SetPosition(pos);

        // set the fading parameters for the beginning fade in of the game
        // over screen
        fader_ = new Fader(0.0f, 3.0f, 3.0f);
        fader_.FadeIn();

        // set the initial update state to fade in
        update_ = fadeIn;
    }
Example #3
0
    //-------------------------------------------------------------------------
    void Awake()
    {
        fader = new Fader(0.0f, 3.0f, 0.0f);
        AgainButton.SetScale(0.30f);
        ExitButton.SetScale(0.30f);
        float x = Screen.width - ExitButton.GetWidth();

        AgainButton.SetPosition(new Vector2(x - 405, 655.0f));
        ExitButton.SetPosition(new Vector2(x - 100, 655.0f));
    }