Beispiel #1
0
    public Menu()
    {
        menuMusic = new Music();
        menuMusic.soundChannel = menuMusic.gameTrack.Play();

        _menubg = new Menubg();
        AddChild(_menubg);
        _menubg.x = game.width / 2;
        _menubg.y = game.height / 2;
        _menubg.SetOrigin(_menubg.width / 2, _menubg.height / 2);
        _menubg.scaleX = (0.93f);
        _menubg.scaleY = (0.93f);

        _button = new Button();
        AddChild(_button);
        _button.SetOrigin(_button.width / 2, _button.height / 2);
        _button.y      = (game.height - _button.height) / 4 + 150;
        _button.scaleX = (0.7f);
        _button.scaleY = (0.7f);

        _quitbutton = new QuitButton();
        AddChild(_quitbutton);
        _quitbutton.SetOrigin(_quitbutton.width / 2, _quitbutton.height / 2);
        _quitbutton.y      = (game.height - _quitbutton.height) * 1.25f + 150;
        _quitbutton.scaleX = (0.7f);
        _quitbutton.scaleY = (0.7f);

        _contbutton = new ContButton();
        AddChild(_contbutton);
        _contbutton.SetOrigin(_contbutton.width / 2, _contbutton.height / 2);
        _contbutton.y      = (game.height - _contbutton.height) / 2 + 150;
        _contbutton.scaleX = (0.7f);
        _contbutton.scaleY = (0.7f);

        _optbutton = new OptButton();
        AddChild(_optbutton);
        _optbutton.SetOrigin(_optbutton.width / 2, _optbutton.height / 2);
        _optbutton.y      = (game.height - _optbutton.height) / 1.33f + 150;
        _optbutton.scaleX = (0.7f);
        _optbutton.scaleY = (0.7f);

        _introbutton = new IntroButton();
        AddChild(_introbutton);
        _introbutton.SetOrigin(_introbutton.width / 2, _introbutton.height / 2);
        _introbutton.y      = (game.height - _introbutton.height) + 150;
        _introbutton.scaleX = (0.7f);
        _introbutton.scaleY = (0.7f);

        _contpage = new ContPage();
        AddChild(_contpage);
        _contpage.SetOrigin(_contpage.width / 2, _contpage.height / 2);
        _contpage.x       = (game.width - _contpage.width) / 2;
        _contpage.y       = (game.height - _contpage.height) / 2;
        _contpage.visible = false;

        _intro = new Intro();
        AddChild(_intro);
        _intro.width  = game.width;
        _intro.height = game.height;

        _insertpage = new InsertPage();
        AddChild(_insertpage);
        _insertpage.width  = game.width;
        _insertpage.height = game.height;

        //_intro.SetScaleXY(game.width / _intro.width, game.height / _intro.height);
        //_intro.SetScaleXY(0.93f, 0.93f);
        _intro.x = (game.width - _intro.width) / 2;
        _intro.y = (game.height - _intro.height) / 2;

        _vol0 = new Vol0();
        AddChild(_vol0);
        _vol0.visible = false;

        _vol20 = new Vol20();
        AddChild(_vol20);
        _vol20.visible = false;

        _vol40 = new Vol40();
        AddChild(_vol40);
        _vol40.visible = false;

        _vol60 = new Vol60();
        AddChild(_vol60);
        _vol60.visible = false;

        _vol80 = new Vol80();
        AddChild(_vol80);
        _vol80.visible = false;

        _vol100 = new Vol100();
        AddChild(_vol100);
        _vol100.visible = false;
    }
Beispiel #2
0
    //int Keyv;

    public Menu()
    {
        _gamestarted          = false;
        MyGame.gameHasStarted = false;

        menuMusic = new Music();
        menuMusic.musicSoundChannel = menuMusic.gameTrack.Play();

        _menubg = new Menubg();
        AddChild(_menubg);
        _menubg.x = MyGame.OldX() / 2;
        _menubg.y = MyGame.OldY() / 2;
        _menubg.SetOrigin(_menubg.width / 2, _menubg.height / 2);
        _menubg.SetScaleXY(MyGame.OldX() / _menubg.width, MyGame.OldY() / _menubg.height);

        /*
         * _menubg.scaleX = (0.93f);
         * _menubg.scaleY = (0.93f);*/

        _button = new Button();
        AddChild(_button);
        _button.SetOrigin(_button.width / 2, _button.height / 2);
        _button.y      = (MyGame.OldY() - _button.height) / 4 + 150;
        _button.scaleX = (0.7f);
        _button.scaleY = (0.7f);

        _quitbutton = new QuitButton();
        AddChild(_quitbutton);
        _quitbutton.SetOrigin(_quitbutton.width / 2, _quitbutton.height / 2);
        _quitbutton.y      = (MyGame.OldY() - _quitbutton.height) * 1.25f + 150;
        _quitbutton.scaleX = (0.7f);
        _quitbutton.scaleY = (0.7f);

        _contbutton = new ContButton();
        AddChild(_contbutton);
        _contbutton.SetOrigin(_contbutton.width / 2, _contbutton.height / 2);
        _contbutton.y      = (MyGame.OldY() - _contbutton.height) / 2 + 150;
        _contbutton.scaleX = (0.7f);
        _contbutton.scaleY = (0.7f);

        _optbutton = new OptButton();
        AddChild(_optbutton);
        _optbutton.SetOrigin(_optbutton.width / 2, _optbutton.height / 2);
        _optbutton.y      = (MyGame.OldY() - _optbutton.height) / 1.33f + 150;
        _optbutton.scaleX = (0.7f);
        _optbutton.scaleY = (0.7f);

        _introbutton = new IntroButton();
        AddChild(_introbutton);
        _introbutton.SetOrigin(_introbutton.width / 2, _introbutton.height / 2);
        _introbutton.y      = (MyGame.OldY() - _introbutton.height) + 150;
        _introbutton.scaleX = (0.7f);
        _introbutton.scaleY = (0.7f);

        _contpage = new ContPage();
        AddChild(_contpage);
        _contpage.SetOrigin(_contpage.width / 2, _contpage.height / 2);
        _contpage.x       = (MyGame.OldY() - _contpage.width) / 2;
        _contpage.y       = (MyGame.OldY() - _contpage.height) / 2;
        _contpage.visible = false;

        _intro = new Intro();
        AddChild(_intro);
        _intro.SetScaleXY(MyGame.OldX() / _intro.width, MyGame.OldY() / _intro.height);

        _insertpage = new InsertPage();
        AddChild(_insertpage);
        _insertpage.SetScaleXY(MyGame.OldX() / _insertpage.width, MyGame.OldY() / _insertpage.height);

        _intro.x = (MyGame.OldX() - _intro.width) / 2;
        _intro.y = (MyGame.OldY() - _intro.height) / 2;

        _vol0 = new Vol0();
        AddChild(_vol0);
        _vol0.visible = false;

        _vol20 = new Vol20();
        AddChild(_vol20);
        _vol20.visible = false;

        _vol40 = new Vol40();
        AddChild(_vol40);
        _vol40.visible = false;

        _vol60 = new Vol60();
        AddChild(_vol60);
        _vol60.visible = false;

        _vol80 = new Vol80();
        AddChild(_vol80);
        _vol80.visible = false;

        _vol100 = new Vol100();
        AddChild(_vol100);
        _vol100.visible = false;
    }