Parcourir la source

Particles2D: Support Direction mode (not tested)

trethaller il y a 7 ans
Parent
commit
ee3a2f827e
1 fichiers modifiés avec 4 ajouts et 0 suppressions
  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);
 		}
 	}