コード例 #1
0
ファイル: NewMapState.cs プロジェクト: Hengle/Fusion3D
        public override void InitState()
        {
            SUI = new UI();


            var bg = new ImageForm().Set(0, 0, AppInfo.W, AppInfo.H, "").SetImage(new Texture2D("FoomED/bg1.jpg", LoadMethod.Single, false));

            SUI.Root.Add(bg);

            var back = new ButtonForm().Set(5, 5, 80, 30, "Back");

            bg.Add(back);

            back.Click = (b) =>
            {
                FusionApp.PopState();
            };

            var lab = new LabelForm().Set(25, 80, 200, 30, "Map Title:");

            bg.Add(lab);

            TextBoxForm map_name = new TextBoxForm().Set(120, 75, 200, 30, "") as TextBoxForm;

            bg.Add(map_name);

            map_name.Enter = (txt) =>
            {
                Directory.CreateDirectory("Game/Maps/" + txt + "/");

                var edit_state = new EditMapState(txt);
                FusionApp.PushState(edit_state);
            };
        }
コード例 #2
0
        public override void InitState()
        {
            base.InitState();

            MenuSongSrc = new VSoundSource("Foom/Song/menu1.mp3");
            //e2
            MenuSongSound = MenuSongSrc.Play2D(true);


            SUI = new FusionEngine.Resonance.UI();

            var TitleBG = new ImageForm().Set(0, 0, AppInfo.W, AppInfo.H).SetImage(new Texture2D("Foom/Img/titlebg1.jpg", LoadMethod.Single, false));

            var foomLab = new ImageForm().Set(AppInfo.W / 2 - 350, 40, 700, 356).SetImage(new Texture2D("Foom/Img/foom1.png", LoadMethod.Single, true));

            TitleBG.Add(foomLab);

            var StartGame = new ButtonForm().Set(AppInfo.W / 2 - 120, 380, 260, 40, "Begin...");
            var ExitGame  = new ButtonForm().Set(AppInfo.W / 2 - 120, 430, 260, 40, "Leave...");

            TitleBG.Add(StartGame);
            TitleBG.Add(ExitGame);

            SUI.Root.Add(TitleBG);

            StartGame.Click = (b) =>
            {
                MenuSongSound.Stop();
                FusionApp.PushState(new IntroState(), true);
            };
        }
コード例 #3
0
ファイル: MainMenuState.cs プロジェクト: Hengle/Fusion3D
        public override void InitState()
        {
            base.InitState();

            var win = new WindowForm().Set(50, 50, 450, 300, "FoomED");

            var bg = new ImageForm().Set(0, 0, AppInfo.W, AppInfo.H, "").SetImage(new Texture2D("FoomED/bg1.jpg", LoadMethod.Single, false));

            SUI = new UI();

            var new_map = new ButtonForm().Set(10, 40, 120, 30, "New Map");

            win.Add(new_map);

            SUI.Root.Add(bg);

            SUI.Root.Add(win);

            new_map.Click = (b) =>
            {
                FusionApp.PushState(new NewMapState());
            };
        }