Ejemplo n.º 1
0
        public Texture.Texture2D ToTexture2D()
        {
            var nt = new Vivid.Texture.Texture2D();

            nt.ID      = ID;
            nt.W       = Width;
            nt.H       = Height;
            nt.Path    = Path;
            nt.RawData = RawData;
            nt.Alpha   = Alpha;
            return(nt);
        }
Ejemplo n.º 2
0
 public BigShotProjector()
 {
     Name           = "Big Shot";
     HudImg         = new Vivid.Texture.Texture2D("Corona/img/icon/bigshoticon.png", Vivid.Texture.LoadMethod.Single, true);
     Img            = new Vivid.Tex.Tex2D("Corona/img/icon/bigshoticon.png", true);
     ImgFrame       = Img;
     Light1         = new Vivid.Scene.GraphLight();
     Light1.X       = X;
     Light1.Y       = Y;
     Light1.Range   = 300;
     Light1.Diffuse = new OpenTK.Vector3(0, 0.4f, 0.4f);
 }
Ejemplo n.º 3
0
        public static Vivid.Texture.Texture2D BlurImage(Vivid.Texture.Texture2D img, float blur)
        {
            FXBlur.Blur = blur;

            FB.Bind();

            FXBlur.Bind();

            //var rt = new Fusion3D.Texture.VTex2D(img.W, img.H, false);

            img.Bind(0);

            FXBlur.Bind();

            DrawQuad();

            FXBlur.Release();

            img.Release(0);

            FB.Release();

            return(FB.BB);
        }
Ejemplo n.º 4
0
 public void InitUI()
 {
     Black     = new Texture.Texture2D("data/ui/black.png", Texture.LoadMethod.Single, false);
     Font      = new Font2D("data/font/times.ttf.vf");
     CursorImg = new Texture.Texture2D("data/ui/cursor1.png", Vivid.Texture.LoadMethod.Single, true);
 }
Ejemplo n.º 5
0
        public ContextMenuForm()
        {
            W = 120;
            if (BG == null)
            {
                BG = new Texture.Texture2D("data/nxUI/bg/winBody4.png", Texture.LoadMethod.Single, true);
            }

            MouseMove = (x, y, dx, dy) =>
            {
                int h = 2;

                foreach (var sub_item in Items)
                {
                    //DrawText(sub_item.Text, 2, h, new OpenTK.Vector4(0.2f, 0.2f, 0.2f, 0.9f));
                    if (x > 0 && x < W && y > h && y < (h + 25))
                    {
                        if (OverItem != null && OverItem != sub_item)
                        {
                            if (Forms.Contains(OverItem.Menu))
                            {
                                Forms.Remove(OverItem.Menu);
                            }
                        }
                        OverItem = sub_item;
                    }
                    h = h + 25;
                }
                if (OverItem != null)
                {
                    if (OverItem.Menu.Items.Count > 0)
                    {
                        OverItem.Menu.X = W;
                        OverItem.Menu.Y = 10;
                        OverItem.Menu.W = 120;
                        OverItem.Menu.H = OverItem.Menu.Items.Count * 25;
                        if (!Forms.Contains(OverItem.Menu))
                        {
                            Add(OverItem.Menu);
                        }
                    }
                }
            };
            MouseLeave = () =>
            {
                //  UI.CurUI.ActiveMenu = null;
            };

            Click = (b) =>
            {
                if (b == 0)
                {
                    if (OverItem != null)
                    {
                        OverItem.Click?.Invoke();
                        UI.CurUI.ActiveMenu = null;
                    }
                    ;
                }
            };

            Draw = () =>
            {
                W = 120;
                H = Items.Count * 25;

                int bw = 0;
                foreach (var sub in Items)
                {
                    int w = UI.Font.Width(sub.Text) + 10;
                    if (w > bw)
                    {
                        bw = w;
                    }
                }
                W = bw;
                if (W < 80)
                {
                    W = 80;
                }
                DrawFormSolid(new OpenTK.Vector4(0.2f, 0.2f, 0.2f, 0.7f), -3, -3, W + 6, H + 6);
                DrawForm(BG, new OpenTK.Vector4(0.9f, 0.9f, 0.9f, 0.5f));
                int h = 2;

                foreach (var sub_item in Items)
                {
                    if (OverItem == sub_item)
                    {
                        DrawFormSolid(new OpenTK.Vector4(0.5f, 0.5f, 0.5f, 0.75f), 0, h, W, 25);
                    }
                    DrawText(sub_item.Text, 2, h, new OpenTK.Vector4(1f, 1f, 1f, 0.95f));
                    h = h + 25;
                }

                //DrawItem(GX, GY);
                //    DrawFormSolid(new OpenTK.Vector4(0.2f, 0.2f, 0.2f, 0.9f), -1, -1, W + 2, H + 2);
                //   DrawFormSolid(new OpenTK.Vector4(0.9f, 0.9f, 0.9f,0.9f));
            };
        }
Ejemplo n.º 6
0
 public LongShotProjector()
 {
     Name   = "Long Shot";
     HudImg = new Vivid.Texture.Texture2D("Corona/img/icon/longshoticon.png", Vivid.Texture.LoadMethod.Single, true);
 }