DebugLayer re-add thickness argument
This commit is contained in:
@@ -12,8 +12,8 @@ using kiss_flixel.DebugLayer;
|
|||||||
|
|
||||||
@:build(kiss.Kiss.build())
|
@:build(kiss.Kiss.build())
|
||||||
class DebugLayer extends FlxTypedGroup<FlxSprite> {
|
class DebugLayer extends FlxTypedGroup<FlxSprite> {
|
||||||
public function drawRect(X:Float, Y:Float, Width:Float, Height:Float, outlineColor:FlxColor = FlxColor.WHITE):FlxSprite {
|
public function drawRect(X:Float, Y:Float, Width:Float, Height:Float, outlineColor:FlxColor = FlxColor.WHITE, thickness = 1.0):FlxSprite {
|
||||||
var thickness = 1.0 / cameras[0].zoom;
|
thickness /= cameras[0].zoom;
|
||||||
|
|
||||||
var s = new FlxSprite(X-thickness/2, Y-thickness/2);
|
var s = new FlxSprite(X-thickness/2, Y-thickness/2);
|
||||||
|
|
||||||
@@ -24,8 +24,18 @@ class DebugLayer extends FlxTypedGroup<FlxSprite> {
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function drawFlxRect(rect:FlxRect, outlineColor:FlxColor = FlxColor.WHITE):FlxSprite {
|
public function drawFlxRect(rect:FlxRect, outlineColor:FlxColor = FlxColor.WHITE, thickness = 1.0):FlxSprite {
|
||||||
return drawRect(rect.x, rect.y, rect.width, rect.height, outlineColor);
|
return drawRect(rect.x, rect.y, rect.width, rect.height, outlineColor, thickness);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function drawCircle(x:Float, y:Float, radius: Float, color = FlxColor.WHITE, thickness = 1.0):FlxSprite {
|
||||||
|
thickness /= cameras[0].zoom;
|
||||||
|
|
||||||
|
var s = new FlxSprite(x - radius - thickness/2, y - radius - thickness/2);
|
||||||
|
s.mg(2 * (radius + thickness), 2 * (radius + thickness));
|
||||||
|
s.drawCircle(s.width / 2, s.height / 2, FlxColor.TRANSPARENT, {color:color, thickness:thickness});
|
||||||
|
add(s);
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function mg(s:FlxSprite, Width:Float, Height:Float):FlxSprite {
|
public static function mg(s:FlxSprite, Width:Float, Height:Float):FlxSprite {
|
||||||
|
Reference in New Issue
Block a user