浏览代码

Particles2D: Support Direction mode (not tested)

trethaller 7 年之前
父节点
当前提交
ee3a2f827e
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      hide/view/Particles2D.hx

+ 4 - 0
hide/view/Particles2D.hx

@@ -311,6 +311,10 @@ class Particles2D extends FileView {
 				var w = pGroup.emitDist;
 				var h = pGroup.emitDistY;
 				g.drawRect(x - w, y - h, w * 2, h * 2);
+			case Direction:
+				var angle = Math.PI * pGroup.emitAngle;
+				g.moveTo(x, y);
+				g.lineTo(x + Math.cos(angle) * pGroup.emitDist, y + Math.sin(angle) * pGroup.emitDist);
 		}
 	}