Esempio n. 1
0
        public void drawImgCentered(dynamic img, dynamic w, dynamic h, dynamic alpha)
        {
            int cx = App.AppInfo.RW / 2;
            int cy = App.AppInfo.RH / 2;

            IntelliDraw.DrawImg(cx - w / 2, cy - h / 2, w, h, img, new OpenTK.Vector4(1, 1, 1, alpha));
        }
Esempio n. 2
0
        public void drawLine(dynamic x, dynamic y, dynamic x2, dynamic y2, dynamic r, dynamic g, dynamic b)
        {
            if (whiteTex == null)
            {
                whiteTex = new Texture2D("syn/data/whiteTex.png", LoadMethod.Single, false);
            }

            dynamic xd    = x2 - x;
            dynamic yd    = y2 - y;
            dynamic steps = 0;

            if (Math.Abs(xd) > Math.Abs(yd))
            {
                steps = Math.Abs(xd);
            }
            else
            {
                steps = Math.Abs(yd);
            }
            dynamic xi = xd / steps;
            dynamic yi = yd / steps;

            for (int i = 0; i < steps; i++)
            {
                IntelliDraw.DrawImg((int)x, (int)y, 2, 2, whiteTex, new OpenTK.Vector4(r, g, b, 1.0f));
                x = x + xi;
                y = y + yi;
            }
        }
Esempio n. 3
0
 public void drawRect(dynamic x, dynamic y, dynamic w, dynamic h, dynamic r, dynamic g, dynamic b)
 {
     if (whiteTex == null)
     {
         whiteTex = new Texture2D("syn/data/whiteTex.png", LoadMethod.Single, false);
     }
     IntelliDraw.DrawImg((int)x, (int)y, (int)w, (int)h, whiteTex, new OpenTK.Vector4(r, g, b, 1));
 }
Esempio n. 4
0
        public GameViewMap()
        {
            InitializeComponent();

            View.UpdateCall = () =>
            {
                GGraph.Update();
                View.Invalidate();
                UpdateViewMatrix();
                GGraph.SetViewMatrix(ViewMat);
                //TrinityEdit.CConsole.DebugMsg("update");
                //TrinityEngine.Texture.Texture2D.UpdateLoading();
            };
            View.RenderCall = () =>
            {
                if (!resources)
                {
                    resources = true;
                    GGraph.CreateResources();
                }
                GGraph.CenterX    = View.ClientSize.Width / 2;
                GGraph.CenterY    = View.ClientSize.Height / 2;
                GGraph.ViewMatrix = ViewMat;
                GGraph.PreRender();
                GGraph.Render();

                if (testc == null)
                {
                    testc = new TrinityEngine.Texture.Texture2D("Content/edit/marker.png", TrinityEngine.Texture.LoadMethod.Single, true);
                }

                if (TrinityEngine.Graph.GraphNode2DMap.NM != null)
                {
                    OpenTK.Vector2[] rpos = TrinityEngine.Graph.GraphNode2DMap.NM.GetRenderPos(1, 1);

                    IntelliDraw.BeginDraw();
                    IntelliDraw.ViewMatrix = OpenTK.Matrix4.Identity;

                    IntelliDraw.DrawImg((int)rpos[3].X, (int)rpos[3].Y, 20, 20, testc, new OpenTK.Vector4(1, 1, 1, 1));

                    IntelliDraw.EndDraw2D();
                }
                //TrinityEdit.CConsole.DebugMsg("Rendered.");
                //IntelliDraw.
                View.AutoValidate = AutoValidate.Disable;
                // x = x + 1;
            };
            CamX        = CamY = 0;
            CamZ        = 1;
            CamRotation = 0;
        }
Esempio n. 5
0
 public void endDraw()
 {
     IntelliDraw.EndDraw();
 }
Esempio n. 6
0
 public void beginDraw()
 {
     IntelliDraw.BeginDraw();
 }
Esempio n. 7
0
 public dynamic drawImg(dynamic img, dynamic x, dynamic y, dynamic w, dynamic h)
 {
     IntelliDraw.DrawImg((int)x, (int)y, (int)w, (int)h, img, new OpenTK.Vector4(1, 1, 1, 1));
     return(null);
 }