예제 #1
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);
			}
		}
예제 #2
0
		public virtual void Dispose() {
			if (data != null) {
				data.Dispose();
				data = null;
			}
		}
예제 #3
0
		public static LTexture.Mask CreateMask(int[] 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;
		}