Example #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            RasterizerState rs = new RasterizerState();

            rs.CullMode             = CullMode.CullCounterClockwiseFace;
            rs.DepthBias            = 10;
            rs.FillMode             = FillMode.WireFrame;
            rs.MultiSampleAntiAlias = true;
            rs.SlopeScaleDepthBias  = 1100;

            graphics.GraphicsDevice.RasterizerState = rs;


            sprite_batch = new SpriteBatch(GraphicsDevice);

            // создать описание формата вершин
            // vertexDeclaration = new VertexDeclaration(vertexList);

            // создать объект Effect используя контент менеджер
            effect = Content.Load <Effect>("Effect");

            Camera.Init(Resolution);

            int_pos = new Vector2(A._g.Resolution.X - 128, 0);

            Textures.Init();
            Fonts.Init();



            ins_size = new Trackbar("Brush Size", 0, 3, 1.5f, false);

            string[] mmm = { "RandomRotate", "MouseRotate", "NonRotate" };
            DrawMethod = new Trackbar("DrawMethod", mmm, 0);



            Interface = new Panel("", null);

            Wire = new CheckBox("Wire");


            Interface.Add(Wire);

            #region Geometry
            Panel bbb = new Panel("Geometry", Interface);
            bbb.Add(new Button("Devide", Devide));
            bbb.Add(new Button("Tesselate", Tesselate));
            // Interface.Add(bbb);
            #endregion

            #region Instruments
            Instruments        = new Panel("Instruments", Interface);
            current_instrument = new Instrument("Draw", Draw_, Instruments);
            current_instrument.text_must_color = Color.White;
            new Instrument("Mask", Draw_Mask, Instruments);
            // Interface.Add(iii);
            #endregion

            // current_instrument =
            #region Channels
            Channels = new Panel("Channels", Interface);
            string[] ch = { "texture" };
            Channel = new Trackbar(ch, 0, Update_interface);
            Channels.Add(new Button("Add Channel", Add_Channel));
            Channels.Add(new Button("Delete Channel", Delete_Channel));
            Add_Channel();

            t_usage = new CheckBox("USED", set_usage_value);

            ShowMethod = new Trackbar(Enum.GetNames(typeof(Show_Method)), 0, set_method_value);

            Channels.Add(ShowMethod);
            Channels.Add(Channel);
            Channels.Add(t_usage);

            // Interface.Add(Channels);
            #endregion

            #region Brushes
            Brushes = new Panel("Brush", Interface);
            Brushes.Add(DrawMethod);
            Brushes.Add(ins_size);
            // Interface.Add(Brushes);
            #endregion

            #region Palette
            Palette     = new Panel("Color", Interface);
            cA          = new Trackbar("A", 0, 255, 255, false);
            cR          = new Trackbar("R", 0, 255, 255, false);
            cG          = new Trackbar("G", 0, 255, 255, false);
            cB          = new Trackbar("B", 0, 255, 255, false);
            CRandomizer = new Trackbar("random", 0, 1, 0, false);

            CRandomizer.text_must_color = Color.FromNonPremultiplied(0, 0, 0, 200);

            cR.size = new Vector2(128, 10); cR.text_position_add = new Vector2(0, -2);
            cG.size = new Vector2(128, 10); cG.text_position_add = new Vector2(0, -2);
            cB.size = new Vector2(128, 10); cB.text_position_add = new Vector2(0, -2);
            cA.size = new Vector2(128, 10); cA.text_position_add = new Vector2(0, -2);
            //  CRandomizer.size = new Vector2(128, 10); CRandomizer.text_position_add = new Vector2(0, -2);

            Palette.Add(cR);
            Palette.Add(cG);
            Palette.Add(cB);
            Palette.Add(cA);
            Palette.Add(CRandomizer);
            Palette.Add(new Button("Clear", _Clear));
            // Interface.Add(Palette);
            #endregion

            t_panel = new Texture_Panel();
            for (int i = 0; i < Textures.tex.Count; i++)
            {
                t_panel.controls.Add(new Ins_Tex(i));
            }


            effect.Parameters["Scale"].SetValue(Matrix.CreateScale(1));
            Interface.can_hiden = false;

            Update_interface();
        }
Example #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            RasterizerState rs = new RasterizerState();
            rs.CullMode = CullMode.CullCounterClockwiseFace;
            rs.DepthBias = 10;
            rs.FillMode = FillMode.WireFrame;
            rs.MultiSampleAntiAlias = true;
            rs.SlopeScaleDepthBias = 1100;

            graphics.GraphicsDevice.RasterizerState = rs;

            sprite_batch = new SpriteBatch(GraphicsDevice);

            // создать описание формата вершин
            // vertexDeclaration = new VertexDeclaration(vertexList);

            // создать объект Effect используя контент менеджер
            effect = Content.Load<Effect>("Effect");

            Camera.Init(Resolution);

            int_pos = new Vector2(A._g.Resolution.X - 128, 0);

            Textures.Init();
            Fonts.Init();

            ins_size = new Trackbar("Brush Size", 0, 3, 1.5f, false);

            string[] mmm = { "RandomRotate", "MouseRotate", "NonRotate" };
            DrawMethod = new Trackbar("DrawMethod", mmm, 0);

            Interface = new Panel("",null);

            Wire = new CheckBox("Wire");

            Interface.Add(Wire);

            #region Geometry
            Panel bbb = new Panel("Geometry",Interface);
            bbb.Add(new Button("Devide", Devide));
            bbb.Add(new Button("Tesselate", Tesselate));
               // Interface.Add(bbb);
            #endregion

            #region Instruments
            Instruments = new Panel("Instruments", Interface);
            current_instrument = new Instrument("Draw", Draw_, Instruments);
            current_instrument.text_must_color = Color.White;
                                   new Instrument("Mask", Draw_Mask, Instruments);
               // Interface.Add(iii);
            #endregion

               // current_instrument =
            #region Channels
            Channels = new Panel("Channels",Interface);
            string[] ch = { "texture" };
            Channel = new Trackbar(ch,0,Update_interface);
            Channels.Add(new Button("Add Channel", Add_Channel));
            Channels.Add(new Button("Delete Channel", Delete_Channel));
            Add_Channel();

            t_usage = new CheckBox("USED", set_usage_value);

            ShowMethod = new Trackbar(Enum.GetNames(typeof(Show_Method)), 0, set_method_value);

            Channels.Add(ShowMethod);
            Channels.Add(Channel);
            Channels.Add(t_usage);

               // Interface.Add(Channels);
            #endregion

            #region Brushes
            Brushes = new Panel("Brush", Interface);
            Brushes.Add(DrawMethod);
            Brushes.Add(ins_size);
               // Interface.Add(Brushes);
            #endregion

            #region Palette
            Palette = new Panel("Color",Interface);
            cA = new Trackbar("A", 0, 255, 255, false);
            cR = new Trackbar("R", 0, 255, 255, false);
            cG = new Trackbar("G", 0, 255, 255, false);
            cB = new Trackbar("B", 0, 255, 255, false);
            CRandomizer = new Trackbar("random", 0, 1, 0, false);

            CRandomizer.text_must_color = Color.FromNonPremultiplied(0,0,0,200);

            cR.size = new Vector2(128, 10); cR.text_position_add = new Vector2(0, -2);
            cG.size = new Vector2(128, 10); cG.text_position_add = new Vector2(0, -2);
            cB.size = new Vector2(128, 10); cB.text_position_add = new Vector2(0, -2);
            cA.size = new Vector2(128, 10); cA.text_position_add = new Vector2(0, -2);
              //  CRandomizer.size = new Vector2(128, 10); CRandomizer.text_position_add = new Vector2(0, -2);

            Palette.Add(cR);
            Palette.Add(cG);
            Palette.Add(cB);
            Palette.Add(cA);
            Palette.Add(CRandomizer);
            Palette.Add(new Button("Clear", _Clear));
               // Interface.Add(Palette);
            #endregion

            t_panel = new Texture_Panel();
            for (int i = 0; i < Textures.tex.Count; i++)
                t_panel.controls.Add(new Ins_Tex(i));

            effect.Parameters["Scale"].SetValue(Matrix.CreateScale(1));
            Interface.can_hiden = false;

            Update_interface();
        }