Exemple #1
0
 public Particle(Tortoise2d game, Texture t, float x, float y, float w, float h, float vx, float vy, float ax, float ay,
     float growx, float growy, float r, float g, float b, float a, float cr, float cg, float cb, float ca, int time)
 {
     this.game = game;
     this.t = t;
     this.x = x;
     this.y = y;
     this.w = w;
     this.h = h;
     this.vx = vx;
     this.vy = vy;
     this.ax = ax;
     this.ay = ay;
     this.growx = growx;
     this.growy = growy;
     this.r = r;
     this.g = g;
     this.b = b;
     this.a = a;
     this.cr = cr;
     this.cg = cg;
     this.cb = cb;
     this.ca = ca;
     this.time = time;
     tick = 0;
     alive = true;
 }
Exemple #2
0
 public Renderable(Tortoise2d t, string textureName)
 {
     this.t = t;
     texture = t.textures.GetSprite(textureName);
     p = new Vector2[4];
     for (int i = 0; i < 4; i++)
     {
         p[i] = new Vector2();
     }
 }
Exemple #3
0
 public Renderable(Tortoise2d t, Texture texture)
 {
     this.t = t;
     this.texture = texture;
     p = new Vector2[4];
     for(int i = 0; i < 4; i++)
     {
         p[i] = new Vector2();
     }
 }
        public ParticleSystem(Tortoise2d game, Texture t, int size)
        {
            this.size = size;
            this.game = game;
            this.t = t;

            parts = new Particle[size];
            for(int i = 0; i < parts.Length; i++)
            {
                parts[i] = new Particle(game, t, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0);
                parts[i].alive = false;
            }
        }
        public Bitmap BuildSuperTexture(Bitmap[] images, out Texture[] textures)
        {
            int[] x, y;
            x = new int[images.Length];
            y = new int[images.Length];
            Texture[] texs = new Texture[images.Length];

            //SortBitmapsBigToSmall(ref images);

            PlaceImages(images, ref x, ref y, ref texs);

            textures = texs;

            return returnPackedBitmaps(images, x, y);
        }
        private void PlaceImages(Bitmap[] images, ref int[] x, ref int[] y, ref Texture[] texs)
        {
            Node start = new Node();
            start.rect = new Rect(0, 0, SIZE, SIZE);

            for (int i = 0; i < images.Length; i++)
            {
                Node thisnode = start.Insert(new Rect(0, 0, images[i].Width, images[i].Height));
                if (thisnode != null)
                {
                    x[i] = thisnode.rect.x;
                    y[i] = thisnode.rect.y;
                    texs[i].u1 = (float)x[i] / (float)SIZE;
                    texs[i].v1 = (float)y[i] / (float)SIZE;
                    texs[i].u2 = (float)(x[i] + thisnode.rect.w) / (float)SIZE;
                    texs[i].v2 = (float)(y[i] + thisnode.rect.h) / (float)SIZE;
                }
            }
        }
Exemple #7
0
 public void AddSpriteTextureRGBA(Texture t, float x, float y, float w, float h, float r, float g, float b, float a)
 {
     core.AddSpriteUVRGBA(grid.TranslateGridScreenX(x), grid.TranslateGridScreenY(y)
                     , grid.TranslateGridScreenX(w), grid.TranslateGridScreenY(h), t.u1, t.v1, t.u2, t.v2, r, g, b, a);
 }
Exemple #8
0
 //adders all ok
 public void AddSpriteTexture(Texture t,float x, float y, float w, float h)
 {
     core.AddSpriteUV(grid.TranslateGridScreenX(x), grid.TranslateGridScreenY(y)
                     , grid.TranslateGridScreenX(w), grid.TranslateGridScreenY(h), t.u1, t.v1, t.u2, t.v2);
 }