Пример #1
0
        protected override void LoadContent()
        {
            base.LoadContent();
            //BackColor = new Color(133, 182, 203);
            BackColor                        = new Color(221, 255, 221);
            BackColor                        = Color.White;
            Debugger.Color                   = Color.Black;
            GraphicsDevice.BlendState        = BlendState.Opaque;
            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.RasterizerState   = RasterizerState.CullCounterClockwise;
            GraphicsDevice.SamplerStates[0]  = SamplerState.LinearWrap;
            _graphics.PreferMultiSampling    = true;
            GameObject con = new GameObject("construct");

            Instantiate(con);
            _construct         = con.AddComponent <ConstructComponent>();
            _construct.Enabled = true;

            Resources.LoadAll();
            InitGUI();
            MainCamera.AddComponent <Grid.Framework.Components.Movable2DCamera>();

            /*
             * GameObject test = new GameObject("test");
             * test.AddComponent<GeometrytestComponent>();
             * test.Enabled = true;
             * Instantiate(test);*/
        }
Пример #2
0
        protected override void LoadContent()
        {
            base.LoadContent();
            GraphicsDevice.BlendState        = BlendState.Opaque;
            GraphicsDevice.DepthStencilState = DepthStencilState.Default;
            GraphicsDevice.RasterizerState   = RasterizerState.CullCounterClockwise;
            GraphicsDevice.SamplerStates[0]  = SamplerState.LinearWrap;
            _graphics.PreferMultiSampling    = true;
            GameObject con = new GameObject("construct");

            _construct         = con.AddComponent <ConstructComponent>();
            _construct.Enabled = true;
            Instantiate(con);

            Resources.LoadAll();

            _compassBtn = new ImageButton(10, 10, 80, 80, LoadContent <Texture2D>("icon\\circle"));
            _segmentBtn = new ImageButton(100, 10, 80, 80, LoadContent <Texture2D>("icon\\segment"));
            _vectorBtn  = new ImageButton(190, 10, 80, 80, LoadContent <Texture2D>("icon\\vector"));
            _lineBtn    = new ImageButton(280, 10, 80, 80, LoadContent <Texture2D>("icon\\line"));
            _dotBtn     = new ImageButton(370, 10, 80, 80, LoadContent <Texture2D>("icon\\dot"));
            _clearBtn   = new Button(460, 10, 80, 80, "Clear")
            {
                BackColor = Color.Azure
            };
            _deleteBtn = new Button(550, 10, 80, 80, "Delete")
            {
                BackColor = Color.Honeydew
            };
            _undoBtn = new Button(640, 10, 80, 80, "Undo")
            {
                BackColor = Color.Violet
            };
            guiManagerComponent.GUIs.Add(_compassBtn);
            guiManagerComponent.GUIs.Add(_segmentBtn);
            guiManagerComponent.GUIs.Add(_vectorBtn);
            guiManagerComponent.GUIs.Add(_lineBtn);
            guiManagerComponent.GUIs.Add(_dotBtn);
            guiManagerComponent.GUIs.Add(_clearBtn);
            guiManagerComponent.GUIs.Add(_deleteBtn);
            guiManagerComponent.GUIs.Add(_undoBtn);

            MainCamera.AddComponent <Grid.Framework.Components.Movable2DCamera>();

            GameObject test = new GameObject("test");

            test.AddComponent <GeometryTestComponent>();
            test.Enabled = false;
            Instantiate(test);
        }