Esempio n. 1
0
        static void Main(string[] args)
        {
            GameSystems.Initialize(new GameStartInfo()
            {
                WindowName = "WindowTestUnit",
                GameName   = "WindowTestUnit",
                IconName   = "",
                WindowSize = new Size <int>(1920, 1080)
            });

            InitializeWindowEvent();

            GameSystems.RunLoop();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            const int width  = 1920;
            const int height = 1080;

            var adapters = GalEngine.Runtime.Graphics.GpuAdapter.EnumerateGraphicsAdapter();

            GameSystems.Initialize(new GameStartInfo()
            {
                WindowName = "Bezier Render System",
                GameName   = "Bezier Render System",
                IconName   = null,
                WindowSize = new Size <int>(width, height),
                Adapter    = adapters[1]
            });

            BezierRender bezierRender = new BezierRender(GameSystems.GpuDevice);

            GameSystems.AddBehaviorSystem(
                new BezierFillSystem(bezierRender,
                                     new Rectangle <int>(0, 0, width, height)));

            /*GameSystems.AddBehaviorSystem(
             * new BezierDrawSystem(bezierRender,
             * new Rectangle<int>(0, 0, width, height)));*/

            GameSystems.MainScene = new GameScene("Main");

            Random random = new Random(0);

            Flower[] flowers = new Flower[500];

            for (int i = 0; i < flowers.Length; i++)
            {
                flowers[i] = new Flower(
                    new Position <float>(random.Next(0, width), random.Next(0, height)),
                    random.Next(100, 200));

                foreach (var leaf in flowers[i].Leaves)
                {
                    GameSystems.MainScene.AddGameObject(leaf);
                }
            }

            GameSystems.RunLoop();
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            GameSystems.Initialize(new GameStartInfo()
            {
                GameName   = "GuiSystemTestUnit",
                WindowName = "GuiSystemTestUnit",
                IconName   = "",
                WindowSize = new Size <int>(1920, 1080)
            });

            var guiText      = new GuiText("This is a test text!", new Font(20), new Color <float>(0, 0, 0, 1));
            var guiButton    = new GuiButton();
            var guiInputText = new GuiInputText("input", 100,
                                                DefaultInputTextProperty.Background,
                                                DefaultInputTextProperty.Frontground, new Font(30));

            //guiInputText.GetComponent<InputTextGuiComponent>().Content = "2333";
            guiInputText.GetComponent <InputTextGuiComponent>().CursorLocation = 1;
            guiInputText.GetComponent <TransformGuiComponent>().Position       = new Position <float>(100, 100);

            (guiButton.GetComponent <ButtonGuiComponent>().Shape as RectangleShape).Size = new Size <float>(80, 40);
            //guiButton.GetComponent<TransformGuiComponent>().Position = new Position<float>(100, 100);

            guiButton.GetComponent <LogicGuiComponent>().EventParts.Get(GuiComponentSupportEvent.MouseClick)
            .Solver += (x, y) =>
            {
                var eventArg = y as GuiComponentMouseClickEvent;

                if (eventArg.IsDown && eventArg.Button == MouseButton.Left)
                {
                    Console.WriteLine(1);
                }
            };

            GameSystems.SystemScene.Root.AddChild(guiButton);
            //GameSystems.SystemScene.Root.AddChild(guiText);
            GameSystems.SystemScene.Root.AddChild(guiInputText);


            GameSystems.VisualGuiSystem.GuiRenderDebugProperty = new GuiRenderDebugProperty()
            {
                //ShapeProperty = new ShapeDebugProperty(2.0f, new Color<float>(1, 0, 0, 1))
            };

            GameSystems.RunLoop();
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            GameSystems.Initialize(new GameStartInfo()
            {
                WindowName = "AssetSystemTestUnit",
                GameName   = "AssetSystemTestUnit",
                IconName   = "",
                WindowSize = new Size <int>(1920, 1080)
            });

            InitializePackage();

            LoadAsset();
            foreach (var asset in mAssets)
            {
                Console.WriteLine(asset.Instance);
            }
            UnLoadAsset();

            GameSystems.RunLoop();
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            ///窗体初始化
            var adps = GalEngine.Runtime.Graphics.GpuAdapter.EnumerateGraphicsAdapter();

            GameSystems.Initialize(new GameStartInfo()
            {
                Name   = "CAG",
                Window = new WindowInfo()
                {
                    Icon = "",
                    Name = "打牌吧!歌姬",
                    Size = new Size(totalWidth, totalHeight)
                },
                Adapter = adps[1]//使用GTX 1050跑
            });
            //-------------------------------------------------------

            //------------启动---------
            Gui.Add(AllSceneToTakeIn.ClientWindow);
            GameSystems.RunLoop();
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            GameSystems.Initialize(new GameStartInfo
            {
                Window = new WindowInfo()
                {
                    Name = "TestUnit",
                    Size = new Size(1920, 1080)
                }
            });


            var stream0 = new AudioStream(@"C:\Users\LinkC\source\love.mp3");
            var stream1 = new AudioStream(@"C:\Users\LinkC\source\free.wav");

            AudioQueue audioQueue0 = new AudioQueue();
            AudioQueue audioQueue1 = new AudioQueue();


            audioQueue0.Add(stream0, 0, stream0.Length);
            audioQueue1.Add(stream1, 0, stream1.Length);


            AudioSource audioSource0 = new AudioSource(stream0.WaveFormat);
            AudioSource audioSource1 = new AudioSource(stream1.WaveFormat);

            audioSource0.SubmitAudioQueue(audioQueue0);
            audioSource1.SubmitAudioQueue(audioQueue1);

            audioSource0.Start();
            audioSource1.Start();


            GameSystems.RunLoop();

            AudioDevice.Terminate();
        }