예제 #1
0
        public Panel2D(EpicoGraphics engine, Controle2D parent)
        {
            _epico = engine;

            Nome   = _nomePadrao;
            Parent = parent ?? throw new ArgumentNullException(nameof(parent));

            var list = ObterObjetosDesteContainer()
                       .Select(obj => new { obj, mult = obj.Pos.X * obj.Pos.Y })
                       .OrderByDescending(x => x.mult).ToList();

            var last = ObterObjetosDesteContainer()
                       .Select(obj => new { obj, mult = obj.Pos.X * obj.Pos.Y })
                       .OrderByDescending(x => x.mult).FirstOrDefault();

            Localizao loc = new Localizao();

            if (last != null)
            {
                loc.X = last.obj.Pos.X + 20;
                loc.Y = last.obj.Pos.X + 20;
            }

            GerarControle(loc.X, loc.Y, 100, 100);
            Mat_render.CorSolida = new RGBA(200, 0, 200, 88);
        }
예제 #2
0
        public Button2D(EpicoGraphics engine, Controle2D parent)
        {
            _epico = engine;

            Nome   = _nomePadrao;
            Parent = parent ?? throw new ArgumentNullException(nameof(parent));

            Vetor2 proxPos = ProximoPosControle();

            GerarControle(proxPos.X, proxPos.Y, 100, 100);
            Mat_render.CorSolida = new RGBA(200, 0, 200, 88);
        }
예제 #3
0
        private void Button1_Click(object sender, EventArgs e)
        {
            EpicoGraphics epico = new EpicoGraphics();
            Estrela       obj   = new Estrela();

            obj.Mat_render.CorBorda  = new Epico.Sistema2D.RGBA(255, 0, 0, 0);
            obj.Mat_render.CorSolida = new Epico.Sistema2D.RGBA(255, 0, 150, 200);
            epico.AddObjeto2D(obj);
            epico.CriarCamera(640, 480);
            epico.Camera.Focar(obj);

            this.BackgroundImage = epico.Camera.Renderizar();
        }
예제 #4
0
        public static IEnumerable <Image> RenderEpico(int width, int height, bool showCursor)
        {
            //Size size = new Size(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);

            EpicoGraphics epico = new EpicoGraphics();
            Estrela       obj   = new Estrela();

            obj.Mat_render.CorBorda  = new Epico.Sistema2D.RGBA(255, 0, 0, 0);
            obj.Mat_render.CorSolida = new Epico.Sistema2D.RGBA(255, 0, 150, 200);
            epico.AddObjeto2D(obj);
            epico.CriarCamera(width, height);
            epico.Camera.Focar(obj);
            epico.Debug = true;

            while (true)
            {
                Bitmap screen = epico.Camera.Renderizar();
                yield return(screen);
            }
        }
예제 #5
0
        public static IEnumerable <Image> RenderEpico(int width, int height, bool showCursor)
        {
            //Size size = new Size(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);

            Epico = new EpicoGraphics();
            Estrela obj = new Estrela();

            obj.Mat_render.CorBorda  = new Epico.Sistema2D.RGBA(255, 0, 0, 0);
            obj.Mat_render.CorSolida = new Epico.Sistema2D.RGBA(255, 0, 150, 200);
            Epico.AddObjeto2D(obj);

            Form2D form = new Form2D();

            form.MouseClick += (sender, e) =>
            {
                Random rnd = new Random(Environment.TickCount);
                byte   a   = (byte)rnd.Next(0, 255);
                byte   r   = (byte)rnd.Next(0, 255);
                byte   g   = (byte)rnd.Next(0, 255);
                byte   b   = (byte)rnd.Next(0, 255);

                form.Mat_render.CorSolida = new Epico.Sistema2D.RGBA(a, r, g, b);
            };

            Epico.AddObjeto2D(form);

            Epico.CriarCamera(width, height);
            Epico.Camera.Focar(obj);
            Epico.Debug = true;

            while (true)
            {
                Bitmap screen = Epico.Camera.Renderizar();
                yield return(screen);
            }
        }