Ejemplo n.º 1
0
 public static LTexture.Mask CreateMask(uint[] pixels, int w, int h)
 {
     int width = w;
     int height = h;
     LTexture.Mask d = new LTexture.Mask(width, height);
     bool[][] mask = (bool[][])CollectionUtils.XNA_CreateJaggedArray(typeof(bool), height, width);
     for (int y = 0; y < height; y++) {
         for (int x = 0; x < width; x++) {
             mask[y][x] = (pixels[x + w * y] & LSystem.TRANSPARENT) == LSystem.TRANSPARENT;
         }
     }
     d.SetData(mask);
     return d;
 }
Ejemplo n.º 2
0
 public void Set(LTexture.Mask d, int x, int y, int w, int h)
 {
     this.data = d;
     if (rect == null) {
         this.rect = new RectBox(x, y, w, h);
     } else {
         this.rect.SetBounds(x, y, w, h);
     }
 }
Ejemplo n.º 3
0
 public virtual void Dispose()
 {
     if (data != null) {
         data.Dispose();
         data = null;
     }
 }