Exemple #1
0
        public void Read(BinaryReader r)
        {
            X    = r.ReadSingle();
            Y    = r.ReadSingle();
            Z    = r.ReadSingle();
            Rot  = r.ReadSingle();
            Name = r.ReadString();

            if (r.ReadBoolean())
            {
                bool alpha = r.ReadBoolean();
                var  tp    = r.ReadString();


                ImgFrame = new Tex.Tex2D(tp, alpha);
            }
            int nc = r.ReadInt32();

            for (int i = 0; i < nc; i++)
            {
                var nn = new GraphNode();
                //nn.Roo = this;

                nn.Graph = Graph;
                Nodes.Add(nn);
                nn.Root = this;
                nn.Read(r);
            }
        }
 public GraphSprite(int w, int h)
 {
     CastShadow = false;
     W          = w;
     H          = h;
     if (NormalBlank == null)
     {
         NormalBlank = new Tex.Tex2D("data/tex/normblank.png", false);
     }
     NormalMap = NormalBlank;
 }
        public static void DrawImg2D(float[] xc, float[] yc, Tex.Tex2D img, Tex.Tex2D norm, Vector4 col, float z = 1.0f)
        {
            if (!begun)
            {
                return;
            }
            var draw_list = GetDrawList(img);

            draw_list.AddDraw(xc, yc, z, img, norm, col);

            Draw_Z += 0.0002f;
        }
        public RainDrop(SceneGraph2D graph)
        {
            if (DropImg == null)
            {
                Rnd     = new Random(Environment.TickCount);
                DropImg = new Tex.Tex2D("Corona/img/fx/raindrop1.png", true);
            }
            DropSprite = new GraphSprite(DropImg, null, 16, 16);
            Graph      = graph;

            DropSprite.X = Rnd.Next(-2500, 2500);
            DropSprite.Y = Rnd.Next(-500, 1000);
            FallZ        = 0.4f + (float)Rnd.NextDouble();

            Graph.Add(DropSprite);
        }
        public SpriteAnim(string path, float spd)
        {
            Speed = spd;

            var fi = new System.IO.DirectoryInfo(path);

            foreach (var f in fi.GetFiles())
            {
                Console.WriteLine("F:" + f.Name);
                if (f.Name.Contains(".cache"))
                {
                    continue;
                }
                var tex = new Tex.Tex2D(path + f.Name, true);
                Frames.Add(tex);
            }
        }
        public override Vivid.Tex.Tex2D Process(Vivid.Tex.Tex2D img)
        {
            if (White == null)
            {
                White = new Tex.Tex2D("Corona/Img/fx/vrgrid1.png", true);
            }
            Vivid.Draw.Render.Begin();
            Vivid.Draw.Render.Image(0, 0, App.AppInfo.W, App.AppInfo.H, White);

            FX.Bind();

            Vivid.Draw.Render.End2D();

            FX.Release();
            //return base.Process(img);//

            return(null);
        }
Exemple #7
0
 public GraphSprite(Tex.Tex2D img, int w = -1, int h = -1)
 {
     ImgFrame = img;
     if (w == -1)
     {
         W = ImgFrame.Width;
     }
     else
     {
         W = w;
     }
     if (h == -1)
     {
         H = ImgFrame.Height;
     }
     else
     {
         H = h;
     }
 }
Exemple #8
0
 public GraphSprite(string path, int w = -1, int h = -1)
 {
     ImgFrame = new Tex.Tex2D(path, true);
     if (w == -1)
     {
         W = ImgFrame.Width;
     }
     else
     {
         W = w;
     }
     if (h == -1)
     {
         H = ImgFrame.Height;
     }
     else
     {
         H = h;
     }
 }
Exemple #9
0
 public GraphSprite(Tex.Tex2D img, Tex.Tex2D normal, int w = -1, int h = -1)
 {
     if (normal != null)
     {
         int vv = 5;
     }
     if (NormalBlank == null)
     {
         NormalBlank = new Tex.Tex2D("data/tex/normblank.png", false);
     }
     if (normal == null)
     {
         NormalMap = NormalBlank;
     }
     CastShadow = false;
     ImgFrame   = img;
     if (normal != null)
     {
         NormalMap = normal;
     }
     if (w == -1)
     {
         W = ImgFrame.Width;
     }
     else
     {
         W = w;
     }
     if (h == -1)
     {
         H = ImgFrame.Height;
     }
     else
     {
         H = h;
     }
 }
 public void SetImage(Tex.Tex2D img)
 {
     ImgFrame = img;
 }
Exemple #11
0
 public SoftParticle(Tex.Tex2D img)
 {
     Img = img;
 }