فهرست منبع

added addPoint

ncannasse 12 سال پیش
والد
کامیت
6fe523d585
2فایلهای تغییر یافته به همراه12 افزوده شده و 0 حذف شده
  1. 8 0
      h2d/TileColorGroup.hx
  2. 4 0
      h2d/css/Fill.hx

+ 8 - 0
h2d/TileColorGroup.hx

@@ -64,6 +64,14 @@ private class TileLayerContent extends h3d.prim.Primitive {
 		tmp[pos++] = b;
 		tmp[pos++] = a;
 	}
+	
+	public function addPoint( x : Float, y : Float, color : Int ) {
+		tmp[pos++] = x;
+		tmp[pos++] = y;
+		tmp[pos++] = 0;
+		tmp[pos++] = 0;
+		insertColor(color);
+	}
 
 	inline function insertColor( c : Int ) {
 		tmp[pos++] = ((c >> 16) & 0xFF) / 255.;

+ 4 - 0
h2d/css/Fill.hx

@@ -14,6 +14,10 @@ class Fill extends h2d.TileColorGroup {
 	public inline function fillRectGradient(x, y, w, h, ctl, ctr, cbl, cbr) {
 		content.rectGradient(x, y, w, h, ctl, ctr, cbl, cbr);
 	}
+	
+	public inline function addPoint(x, y, color) {
+		content.addPoint(x, y, color);
+	}
 
 	public function fillRect(fill:FillStyle,x,y,w,h) {
 		switch( fill ) {