From e160af308cd98fe695994008bae36b1ff47a6f21 Mon Sep 17 00:00:00 2001 From: George FunBook Date: Wed, 11 Sep 2024 11:32:34 -0500 Subject: [PATCH 1/7] improve FlxPieDial demo --- Features/FlxPieDial/source/DemoState.hx | 136 +++++++++++------------- 1 file changed, 62 insertions(+), 74 deletions(-) diff --git a/Features/FlxPieDial/source/DemoState.hx b/Features/FlxPieDial/source/DemoState.hx index 9e8e93701..ac9b74816 100644 --- a/Features/FlxPieDial/source/DemoState.hx +++ b/Features/FlxPieDial/source/DemoState.hx @@ -1,98 +1,86 @@ package; +import flixel.FlxG; +import flixel.FlxState; import flixel.addons.display.FlxPieDial; -import flixel.addons.display.FlxPieDial.FlxPieDialShape; +import flixel.addons.display.FlxPieGuage; +import flixel.group.FlxGroup; import flixel.tweens.FlxTween; -import flixel.FlxState; import flixel.util.FlxColor; class DemoState extends FlxState { + var pieDial:FlxPieDial; + override public function create():Void { super.create(); + FlxG.cameras.bgColor = FlxColor.GRAY; - var i:Int = 0; - var x:Float = 10; - var y:Float = 10; - var shape:FlxPieDialShape = CIRCLE; - var clockwise:Bool = false; - var innerRadius:Int = 0; + final colors = [FlxColor.RED, FlxColor.BLUE, FlxColor.LIME, FlxColor.WHITE]; + final spacingX = 100; + final spacingY = 100; - var createDial = function() + inline function createDial(x, y, color, shape = CIRCLE, clockwise = true, innerRadius = 0, quarters:Int) { - var colors = [FlxColor.RED, FlxColor.BLUE, FlxColor.LIME, FlxColor.WHITE]; - var amounts = [0.25, 0.50, 0.75, 1.00]; - - var dial = new FlxPieDial(x, y, 25, colors[i], 72, shape, clockwise, innerRadius); - dial.amount = amounts[i]; + final dial = new FlxPieDial(x, y, 25, color, 4, shape, clockwise, innerRadius); + dial.amount = quarters * .25; add(dial); - x += 100; - - i++; - if (i > 3) - i = 0; return dial; } - var createFour = function() + inline function createFour(x:Float, y, shape = CIRCLE, clockwise = true, innerRadius = 0) { - for (_ in 0...4) - createDial(); + for (i in 0...4) + createDial(x + i * spacingX, y, colors[i], shape, clockwise, innerRadius, i+1); } - - var nextLine = function() + + var y = 10; + + inline function createEight(shape = CIRCLE, innerRadius = 0) { - x = 10; - y += 100; + createFour(10, y, shape, true, innerRadius); + createFour(spacingX * 4 + 10, y, shape, false, innerRadius); + y += spacingY; } - - // Circular pie dials - shape = CIRCLE; - clockwise = true; - createFour(); - - clockwise = false; - createFour(); - - nextLine(); - - // Square-ular pie dials - shape = SQUARE; - clockwise = true; - createFour(); - - clockwise = false; - createFour(); - - nextLine(); - - // Donut-ular pie dials - shape = CIRCLE; - clockwise = true; - innerRadius = 12; - createFour(); - - clockwise = false; - createFour(); - - nextLine(); - - // Square donut-ular pie dials - shape = SQUARE; - clockwise = true; - createFour(); - - clockwise = false; - createFour(); - - nextLine(); - - // Tweened pie dial - var pieDial = new FlxPieDial(25, y, 25, FlxColor.LIME, 36, FlxPieDialShape.SQUARE, false, 10); - pieDial.amount = 0.0; - add(pieDial); - - FlxTween.tween(pieDial, {amount: 1.0}, 2.0, {type: PINGPONG}); + + createEight(CIRCLE); + createEight(SQUARE); + createEight(CIRCLE, 12); + createEight(SQUARE, 12); + + var x = 10; + final tweened = new FlxTypedGroup(); + inline function createTweened(color, shape, innerRadius = 0, clockwise = true) + { + final dial = new FlxPieDial(x, y, 25, color, 36, shape, clockwise, innerRadius); + tweened.add(dial); + x += spacingX; + + return dial; + } + add(tweened); + + // clockwise + createTweened(colors[0], CIRCLE, 0 , true); + createTweened(colors[1], CIRCLE, 10, true); + createTweened(colors[2], SQUARE, 0 , true); + createTweened(colors[3], SQUARE, 10, true); + // counter-clockwise + createTweened(colors[0], CIRCLE, 0 , false); + createTweened(colors[1], CIRCLE, 10, false); + createTweened(colors[2], SQUARE, 0 , false); + createTweened(colors[3], SQUARE, 10, false); + + FlxTween.num(-0.1, 1.1, 2.0, {type: PINGPONG}, function (n) + { + final n = Math.min(1.0, Math.max(0.0, n)); + for (dial in tweened) + dial.amount = n; + + #if debug + FlxG.watch.addQuick("amount", n); + #end + }); } } From 26c94ddc8040e969b4e0d51f09a7be264ff83656 Mon Sep 17 00:00:00 2001 From: George FunBook Date: Tue, 24 Sep 2024 17:24:21 -0500 Subject: [PATCH 2/7] add guage demo --- Features/FlxPieDial/Project.xml | 1 + Features/FlxPieDial/assets/images/flixel.png | Bin 0 -> 692 bytes Features/FlxPieDial/source/DemoState.hx | 3 - Features/FlxPieDial/source/GuageState.hx | 155 +++++++++++++++++++ 4 files changed, 156 insertions(+), 3 deletions(-) create mode 100644 Features/FlxPieDial/assets/images/flixel.png create mode 100644 Features/FlxPieDial/source/GuageState.hx diff --git a/Features/FlxPieDial/Project.xml b/Features/FlxPieDial/Project.xml index e8b13cc94..b2e6580a4 100644 --- a/Features/FlxPieDial/Project.xml +++ b/Features/FlxPieDial/Project.xml @@ -30,6 +30,7 @@ + diff --git a/Features/FlxPieDial/assets/images/flixel.png b/Features/FlxPieDial/assets/images/flixel.png new file mode 100644 index 0000000000000000000000000000000000000000..cf9836128b2983be17001171db2ec2b79c1d89a0 GIT binary patch literal 692 zcmV;l0!#ggP)Px%Zb?KzRA_X4L+2?Ha*aE4JE zETc3}0BVVp%u_Uz@!PLSrFOEVkc?C(qA>-oO-A~san~xD^l8rHD=-3793zaos}hX# zPXGc)YAVcI#7vBDB|8!NeJ;{5E)5_8Sxe;@2v-T1Nju4j924Pc4YQvHumA~DIR(Pi z0%q3I!9-4pa1~<0G=LR|w7q->ge!+JFwwRad%gVgi1(Xk>fK{my$ag1+0sQw(-`x) z{g1bYU(~kpsvADq`OXsEwHiBr-0Xhh>h6WuSWb0&U*|i@(lO%K{2rJtTriW&AWdX8 ze_G58VHZ#Pj3p91z)yo&KnykMa{`H_F(); + inline function makeTweened(graphic:GuageGraphic, clockwise = true, color = FlxColor.WHITE) + { + final guage = switch (graphic) + { + case SHAPE(shape, innerRadius): + final guage = new FlxPieGuage(x, y); + guage.makePieDialGraphic(shape, 25, innerRadius, color); + guage; + case ASSET(asset): + new FlxPieGuage(x, y, asset); + case MAKE: + final guage = new FlxPieGuage(x, y, FlxG.bitmap.get("make-guage")); + guage.color = color; + guage; + } + + if (!clockwise) + { + guage.setOrientation(270, -90); + } + + tweened.add(guage); + x += spacingX; + + return guage; + } + add(tweened); + + // clockwise + makeTweened(SHAPE(CIRCLE, 0 ), true, colors[0]); + makeTweened(SHAPE(CIRCLE, 10), true, colors[1]); + makeTweened(SHAPE(SQUARE, 0 ), true, colors[2]); + makeTweened(SHAPE(SQUARE, 10), true, colors[3]); + makeTweened(ASSET("assets/images/flixel.png"), true); + makeTweened(MAKE, true, colors[5]); + // counter-clockwise + makeTweened(SHAPE(CIRCLE, 0 ), false, colors[0]); + makeTweened(SHAPE(CIRCLE, 10), false, colors[1]); + makeTweened(SHAPE(SQUARE, 0 ), false, colors[2]); + makeTweened(SHAPE(SQUARE, 10), false, colors[3]); + makeTweened(ASSET("assets/images/flixel.png"), false); + makeTweened(MAKE, false, colors[5]); + + FlxTween.num(-0.1, 1.1, 2.0, {type: PINGPONG}, function (n) + { + final n = Math.min(1.0, Math.max(0.0, n)); + for (dial in tweened) + dial.amount = n; + + #if debug + FlxG.watch.addQuick("amount", n); + #end + }); + } +} + +enum GuageGraphic +{ + SHAPE(shape:FlxPieGuageShape, ?innerRadius:Int); + ASSET(asset:FlxGraphicAsset); + MAKE; +} From bcdb751fd861156b5acec2fe3b58aa171bd9f159 Mon Sep 17 00:00:00 2001 From: George FunBook Date: Thu, 26 Sep 2024 14:02:26 -0500 Subject: [PATCH 3/7] rename and check flash --- .../source/{GuageState.hx => GaugeState.hx} | 78 +++++++++---------- Features/FlxPieDial/source/Main.hx | 5 ++ 2 files changed, 44 insertions(+), 39 deletions(-) rename Features/FlxPieDial/source/{GuageState.hx => GaugeState.hx} (61%) diff --git a/Features/FlxPieDial/source/GuageState.hx b/Features/FlxPieDial/source/GaugeState.hx similarity index 61% rename from Features/FlxPieDial/source/GuageState.hx rename to Features/FlxPieDial/source/GaugeState.hx index c9d70a3f1..dacbf81f1 100644 --- a/Features/FlxPieDial/source/GuageState.hx +++ b/Features/FlxPieDial/source/GaugeState.hx @@ -2,7 +2,7 @@ package; import flixel.FlxG; import flixel.FlxState; -import flixel.addons.display.FlxPieGuage; +import flixel.addons.display.FlxRadialGauge; import flixel.group.FlxGroup; import flixel.system.FlxAssets; import flixel.tweens.FlxTween; @@ -10,16 +10,16 @@ import flixel.util.FlxColor; import openfl.geom.Rectangle; /** - * Demo for the soon to be added feature, FlxPieGuage. Will replace FlxPieDial and this demo + * Demo for the soon to be added feature, FlxRadialGauge. Will replace FlxPieDial and this demo */ -class GuageState extends FlxState +class GaugeState extends FlxState { override public function create():Void { super.create(); FlxG.cameras.bgColor = FlxColor.GRAY; - final graphic = FlxG.bitmap.create(50, 50, FlxColor.BLACK, true, "make-guage"); + final graphic = FlxG.bitmap.create(50, 50, FlxColor.BLACK, true, "make-gauge"); graphic.bitmap.fillRect(new Rectangle(2, 2, 46, 46), FlxColor.WHITE); final colors = [FlxColor.RED, FlxColor.BLUE, FlxColor.LIME, FlxColor.WHITE, FlxColor.YELLOW, FlxColor.MAGENTA]; @@ -27,55 +27,55 @@ class GuageState extends FlxState final spacingY = 71; final setSize = colors.length; - inline function makeStaticShapeGuage(x, y, color:FlxColor, shape:FlxPieGuageShape, clockwise = true, innerRadius:Int, amount:Float) + inline function makeStaticShapeGauge(x, y, color:FlxColor, shape:FlxRadialGaugeShape, clockwise = true, innerRadius:Int, amount:Float) { - final guage = new FlxPieGuage(x, y); - guage.makePieDialGraphic(shape, 25, innerRadius, color); + final gauge = new FlxRadialGauge(x, y); + gauge.makePieDialGraphic(shape, 25, innerRadius, color); if (!clockwise) { - guage.setOrientation(270, -90); + gauge.setOrientation(270, -90); } - guage.amount = amount; - add(guage); - return guage; + gauge.amount = amount; + add(gauge); + return gauge; } - inline function makeStaticAssetGuage(x, y, graphic, clockwise = true, amount:Float, color = FlxColor.WHITE) + inline function makeStaticAssetGauge(x, y, graphic, clockwise = true, amount:Float, color = FlxColor.WHITE) { - final guage = new FlxPieGuage(x, y, graphic); - guage.color = color; + final gauge = new FlxRadialGauge(x, y, graphic); + gauge.color = color; if (!clockwise) { - guage.setOrientation(270, -90); + gauge.setOrientation(270, -90); } - guage.amount = amount; - add(guage); - return guage; + gauge.amount = amount; + add(gauge); + return gauge; } - inline function makeStaticSet(x:Float, y, graphic:GuageGraphic, clockwise = true) + inline function makeStaticSet(x:Float, y, graphic:GaugeGraphic, clockwise = true) { switch (graphic) { case SHAPE(shape, innerRadius): final innerRadius = innerRadius == null ? 0 : innerRadius; for (i in 0...setSize) - makeStaticShapeGuage(x + i * spacingX, y, colors[i], shape, clockwise, innerRadius, (i+1) / setSize); + makeStaticShapeGauge(x + i * spacingX, y, colors[i], shape, clockwise, innerRadius, (i+1) / setSize); case ASSET(asset): for (i in 0...setSize) - makeStaticAssetGuage(x + i * spacingX, y, asset, clockwise, (i+1) / setSize, colors[i]); + makeStaticAssetGauge(x + i * spacingX, y, asset, clockwise, (i+1) / setSize, colors[i]); case MAKE: - final graphic = FlxG.bitmap.get("make-guage"); + final graphic = FlxG.bitmap.get("make-gauge"); for (i in 0...setSize) - makeStaticAssetGuage(x + i * spacingX, y, graphic, clockwise, (i+1) / setSize, colors[i]); + makeStaticAssetGauge(x + i * spacingX, y, graphic, clockwise, (i+1) / setSize, colors[i]); } } var y = 10; - inline function makeStaticRow(graphic:GuageGraphic) + inline function makeStaticRow(graphic:GaugeGraphic) { makeStaticSet(10, y, graphic, true); makeStaticSet(spacingX * setSize + 10, y, graphic, false); @@ -90,32 +90,32 @@ class GuageState extends FlxState makeStaticRow(MAKE); var x = 10; - final tweened = new FlxTypedGroup(); - inline function makeTweened(graphic:GuageGraphic, clockwise = true, color = FlxColor.WHITE) + final tweened = new FlxTypedGroup(); + inline function makeTweened(graphic:GaugeGraphic, clockwise = true, color = FlxColor.WHITE) { - final guage = switch (graphic) + final gauge = switch (graphic) { case SHAPE(shape, innerRadius): - final guage = new FlxPieGuage(x, y); - guage.makePieDialGraphic(shape, 25, innerRadius, color); - guage; + final gauge = new FlxRadialGauge(x, y); + gauge.makePieDialGraphic(shape, 25, innerRadius, color); + gauge; case ASSET(asset): - new FlxPieGuage(x, y, asset); + new FlxRadialGauge(x, y, asset); case MAKE: - final guage = new FlxPieGuage(x, y, FlxG.bitmap.get("make-guage")); - guage.color = color; - guage; + final gauge = new FlxRadialGauge(x, y, FlxG.bitmap.get("make-gauge")); + gauge.color = color; + gauge; } if (!clockwise) { - guage.setOrientation(270, -90); + gauge.setOrientation(270, -90); } - tweened.add(guage); + tweened.add(gauge); x += spacingX; - return guage; + return gauge; } add(tweened); @@ -147,9 +147,9 @@ class GuageState extends FlxState } } -enum GuageGraphic +enum GaugeGraphic { - SHAPE(shape:FlxPieGuageShape, ?innerRadius:Int); + SHAPE(shape:FlxRadialGaugeShape, ?innerRadius:Int); ASSET(asset:FlxGraphicAsset); MAKE; } diff --git a/Features/FlxPieDial/source/Main.hx b/Features/FlxPieDial/source/Main.hx index ef266f628..826e98865 100644 --- a/Features/FlxPieDial/source/Main.hx +++ b/Features/FlxPieDial/source/Main.hx @@ -8,6 +8,11 @@ class Main extends Sprite public function new() { super(); + #if flash addChild(new FlxGame(800, 500, DemoState)); + #else + addChild(new FlxGame(800, 500, GaugeState)); + #end + } } From 02b16a850636d3c803ea97ff78dcd76463439848 Mon Sep 17 00:00:00 2001 From: George FunBook Date: Mon, 30 Sep 2024 15:44:45 -0500 Subject: [PATCH 4/7] add GaugeEditorState --- .../FlxPieDial/source/GaugeEditorState.hx | 263 ++++++++++++++++++ Features/FlxPieDial/source/GaugeState.hx | 49 ++-- Features/FlxPieDial/source/Main.hx | 6 +- 3 files changed, 294 insertions(+), 24 deletions(-) create mode 100644 Features/FlxPieDial/source/GaugeEditorState.hx diff --git a/Features/FlxPieDial/source/GaugeEditorState.hx b/Features/FlxPieDial/source/GaugeEditorState.hx new file mode 100644 index 000000000..6c1744a60 --- /dev/null +++ b/Features/FlxPieDial/source/GaugeEditorState.hx @@ -0,0 +1,263 @@ +package; + +import flixel.FlxG; +import flixel.FlxSprite; +import flixel.addons.display.FlxRadialGauge; +import flixel.input.mouse.FlxMouseEvent; +import flixel.math.FlxPoint; +import flixel.tweens.FlxTween; +import flixel.ui.FlxButton; +import flixel.util.FlxColor; + +using flixel.addons.display.FlxPieDial.FlxPieDialUtils; +/** + * Demo for the soon to be added feature, FlxRadialGauge. Will replace FlxPieDial and this demo + */ +class GaugeEditorState extends flixel.FlxState +{ + final shapeGauge:ShapeGaugeEditor; + final imageGaugeBg:FlxRadialGauge; + final imageGaugeFg:FlxRadialGauge; + + public function new () + { + super(); + + shapeGauge = new ShapeGaugeEditor(FlxG.width / 3, FlxG.height * 0.5, CIRCLE, 100, 75, -225, 45); + + drawLogo(); + imageGaugeBg = new FlxRadialGauge(FlxG.width * 2 / 3, FlxG.height * 0.5, "logo-200x200"); + imageGaugeBg.x -= imageGaugeBg.width * 0.5; + imageGaugeBg.y -= imageGaugeBg.height * 0.5; + imageGaugeBg.color = 0xFF909090; + imageGaugeFg = new FlxRadialGauge(imageGaugeBg.x, imageGaugeBg.y, "logo-200x200"); + } + + function drawLogo() + { + final image = FlxG.bitmap.create(200, 200, 0x0, false, "logo-200x200"); + final logo = new openfl.display.Shape(); + flixel.system.FlxAssets.drawLogo(logo.graphics); + final mat = new flixel.math.FlxMatrix(); + mat.scale(image.width / logo.width, image.height / logo.height); + image.bitmap.draw(logo, mat); + } + + override function create() + { + super.create(); + bgColor = FlxColor.GRAY; + + add(shapeGauge); + add(imageGaugeBg); + add(imageGaugeFg); + } + + override function draw() + { + imageGaugeFg.amount = shapeGauge.getAmount(); + imageGaugeFg.start = imageGaugeBg.start = shapeGauge.getStart(); + imageGaugeFg.end = imageGaugeBg.end = shapeGauge.getEnd(); + final scale = 2 * shapeGauge.radius / imageGaugeBg.frameWidth; + imageGaugeBg.scale.set(scale, scale); + imageGaugeFg.scale.set(scale, scale); + + super.draw(); + } +} + +/** + * A visual editor for a FlxRadialGauge, has draggable objects that determine the gauge's properties + */ +class ShapeGaugeEditor extends flixel.group.FlxSpriteGroup +{ + public var shape:FlxRadialGaugeShape; + public var radius = 0.0; + public var innerRadius = 0.0; + + final gaugeBg:FlxRadialGauge; + final gaugeFg:FlxRadialGauge; + final radiusHandle:DragHandle; + final innerRadiusHandle:DragHandle; + final shapeBtn:FlxButton; + + public function new (x = 0.0, y = 0.0, shape = CIRCLE, radius:Int, innerRadius:Int, start:Float, end:Float) + { + this.shape = shape; + this.radius = radius; + this.innerRadius = innerRadius; + super(0, 0); + + add(gaugeBg = new FlxRadialGauge(-radius, -radius)); + gaugeBg.color = FlxColor.BLACK; + + add(gaugeFg = new FlxRadialGauge(-radius, -radius)); + gaugeFg.color = FlxColor.LIME; + + // Helper point + final pos = FlxPoint.get(); + pos.setPolarDegrees(radius, start); + add(radiusHandle = new DragHandle(pos.x, pos.y, onRadiusChange)); + pos.setPolarDegrees(innerRadius, end); + add(innerRadiusHandle = new DragHandle(pos.x, pos.y, onInnerRadiusChange)); + shapeBtn = new FlxButton(0, 0, '${shape.getName()}', function () + { + this.shape = (this.shape == SQUARE ? CIRCLE : SQUARE); + shapeBtn.text = '${this.shape.getName()}'; + redraw(); + }); + add(shapeBtn); + shapeBtn.x -= shapeBtn.width * 0.5; + shapeBtn.y -= shapeBtn.height * 0.5; + + redraw(); + gaugeBg.setOrientation(start, end); + gaugeFg.setOrientation(start, end); + + + FlxTween.num(-0.1, 1.1, 2.0, {type: PINGPONG}, function (n) + { + final n = Math.min(1.0, Math.max(0.0, n)); + gaugeFg.amount = n; + }); + + // Setting position after everything is added makes it easier to use relative positioning + this.x = x; + this.y = y; + pos.put(); + + #if debug + FlxG.watch.addFunction("shape", ()->shape); + FlxG.watch.addFunction("radius", ()->radius); + FlxG.watch.addFunction("innerRadius", ()->innerRadius); + FlxG.watch.addFunction("start", ()->gaugeBg.start); + FlxG.watch.addFunction("end", ()->gaugeBg.end); + FlxG.watch.addFunction("amount", ()->gaugeFg.amount); + #end + } + + inline function redraw() + { + trace(shape); + gaugeBg.makeShapeGraphic(shape, Math.round(radius), Math.round(innerRadius)); + gaugeFg.makeShapeGraphic(shape, Math.round(radius), Math.round(innerRadius)); + } + + function onRadiusChange() + { + final dis = FlxPoint.get(radiusHandle.x - x, radiusHandle.y - y); + radius = dis.length; + redraw(); + gaugeFg.x = gaugeBg.x = x - radius; + gaugeFg.y = gaugeBg.y = y - radius; + gaugeFg.start = gaugeBg.start = validateAngle(dis.degrees); + dis.put(); + } + + function onInnerRadiusChange() + { + final dis = FlxPoint.get(innerRadiusHandle.x - x, innerRadiusHandle.y - y); + innerRadius = dis.length; + redraw(); + gaugeFg.end = gaugeBg.end = validateAngle(dis.degrees); + dis.put(); + } + + /** Convert angles so that the wrap point is directly down */ + inline function validateAngle(degrees:Float):Float + { + return ((degrees + 270) % 360) - 270; + } + + inline public function getStart() + { + return gaugeBg.start; + } + + inline public function getEnd() + { + return gaugeBg.end; + } + + inline public function getAmount() + { + return gaugeFg.amount; + } +} + +class DragHandle extends FlxSprite +{ + static inline final RADIUS = 10; + static inline final OUTLINE = 2; + static inline final KEY = 'drag-handle-$RADIUS'; + static inline final OVER_COLOR = FlxColor.WHITE; + static inline final OUT_COLOR = 0xFFeeeeee; + + static function getGraphic() + { + // Use existing graphic, if it exists + final graphic = FlxG.bitmap.get(KEY); + if (graphic != null) + return graphic; + + // Generate graphic + final graphic = FlxG.bitmap.create(RADIUS * 2, RADIUS * 2, 0x0, false, KEY); + graphic.bitmap.drawCircle(RADIUS, FlxColor.BLACK); + graphic.bitmap.drawCircle(RADIUS - OUTLINE, FlxColor.WHITE); + return graphic; + } + + /** Called whenever the handle moves */ + public var onChange:()->Void; + + /** Whether this is currently being dragged */ + public var dragging(default, null):Bool = false; + + public function new (x = 0.0, y = 0.0, onChange:()->Void) + { + this.onChange = onChange; + super(x, y, getGraphic()); + offset.set(RADIUS, RADIUS); + color = OUT_COLOR; + + /* + * Track mouse dragging via FlxMouseEvent, as it prevents the user from + * being able to select more than one, with a single click + */ + FlxMouseEvent.add(this, + (_)->dragging = true, // onMouseDown + null, // onMouseUp: handled via update + (_)->color = OVER_COLOR, // onMouseOver + (_)->color = OUT_COLOR, // onMouseOver + false, // moueChildren: Whether other objects overlapped by this will still receive mouse events + true, // mouseEnabled: Whether this object will receive mouse events + true // pixelPerfect: Whether to ignore the graphic's alpha pixels + ); + + #if debug + ignoreDrawDebug = true; + #end + } + + function moveToMouse() + { + x = FlxG.mouse.x; + y = FlxG.mouse.y; + onChange(); + } + + override function update(elapsed:Float) + { + super.update(elapsed); + + if (dragging) + { + // Stop dragging + if (FlxG.mouse.justReleased) + dragging = false; + + if (FlxG.mouse.justMoved) + moveToMouse(); + } + } +} \ No newline at end of file diff --git a/Features/FlxPieDial/source/GaugeState.hx b/Features/FlxPieDial/source/GaugeState.hx index dacbf81f1..c725dd09c 100644 --- a/Features/FlxPieDial/source/GaugeState.hx +++ b/Features/FlxPieDial/source/GaugeState.hx @@ -19,9 +19,8 @@ class GaugeState extends FlxState super.create(); FlxG.cameras.bgColor = FlxColor.GRAY; - final graphic = FlxG.bitmap.create(50, 50, FlxColor.BLACK, true, "make-gauge"); - graphic.bitmap.fillRect(new Rectangle(2, 2, 46, 46), FlxColor.WHITE); - + makeGraphics(); + final colors = [FlxColor.RED, FlxColor.BLUE, FlxColor.LIME, FlxColor.WHITE, FlxColor.YELLOW, FlxColor.MAGENTA]; final spacingX = 66; final spacingY = 71; @@ -30,7 +29,7 @@ class GaugeState extends FlxState inline function makeStaticShapeGauge(x, y, color:FlxColor, shape:FlxRadialGaugeShape, clockwise = true, innerRadius:Int, amount:Float) { final gauge = new FlxRadialGauge(x, y); - gauge.makePieDialGraphic(shape, 25, innerRadius, color); + gauge.makeShapeGraphic(shape, 25, innerRadius, color); if (!clockwise) { gauge.setOrientation(270, -90); @@ -66,10 +65,6 @@ class GaugeState extends FlxState case ASSET(asset): for (i in 0...setSize) makeStaticAssetGauge(x + i * spacingX, y, asset, clockwise, (i+1) / setSize, colors[i]); - case MAKE: - final graphic = FlxG.bitmap.get("make-gauge"); - for (i in 0...setSize) - makeStaticAssetGauge(x + i * spacingX, y, graphic, clockwise, (i+1) / setSize, colors[i]); } } @@ -86,8 +81,8 @@ class GaugeState extends FlxState makeStaticRow(SHAPE(SQUARE)); makeStaticRow(SHAPE(CIRCLE, 12)); makeStaticRow(SHAPE(SQUARE, 12)); - makeStaticRow(ASSET("assets/images/flixel.png")); - makeStaticRow(MAKE); + makeStaticRow(ASSET("logo-50x50")); + makeStaticRow(ASSET("square-50x50")); var x = 10; final tweened = new FlxTypedGroup(); @@ -97,12 +92,10 @@ class GaugeState extends FlxState { case SHAPE(shape, innerRadius): final gauge = new FlxRadialGauge(x, y); - gauge.makePieDialGraphic(shape, 25, innerRadius, color); + gauge.makeShapeGraphic(shape, 25, innerRadius, color); gauge; case ASSET(asset): - new FlxRadialGauge(x, y, asset); - case MAKE: - final gauge = new FlxRadialGauge(x, y, FlxG.bitmap.get("make-gauge")); + final gauge = new FlxRadialGauge(x, y, asset); gauge.color = color; gauge; } @@ -124,32 +117,46 @@ class GaugeState extends FlxState makeTweened(SHAPE(CIRCLE, 10), true, colors[1]); makeTweened(SHAPE(SQUARE, 0 ), true, colors[2]); makeTweened(SHAPE(SQUARE, 10), true, colors[3]); - makeTweened(ASSET("assets/images/flixel.png"), true); - makeTweened(MAKE, true, colors[5]); + makeTweened(ASSET("logo-50x50"), true); + makeTweened(ASSET("square-50x50"), true, colors[5]); // counter-clockwise makeTweened(SHAPE(CIRCLE, 0 ), false, colors[0]); makeTweened(SHAPE(CIRCLE, 10), false, colors[1]); makeTweened(SHAPE(SQUARE, 0 ), false, colors[2]); makeTweened(SHAPE(SQUARE, 10), false, colors[3]); - makeTweened(ASSET("assets/images/flixel.png"), false); - makeTweened(MAKE, false, colors[5]); + makeTweened(ASSET("logo-50x50"), false); + makeTweened(ASSET("square-50x50"), false, colors[5]); FlxTween.num(-0.1, 1.1, 2.0, {type: PINGPONG}, function (n) { final n = Math.min(1.0, Math.max(0.0, n)); - for (dial in tweened) - dial.amount = n; + for (gauge in tweened) + gauge.amount = n; #if debug FlxG.watch.addQuick("amount", n); #end }); } + + function makeGraphics() + { + // Create outlined square + final graphic = FlxG.bitmap.create(50, 50, FlxColor.BLACK, true, "square-50x50"); + graphic.bitmap.fillRect(new Rectangle(2, 2, 46, 46), FlxColor.WHITE); + + // Create logo graphic + final logo = new openfl.display.Shape(); + flixel.system.FlxAssets.drawLogo(logo.graphics); + final mat = new flixel.math.FlxMatrix(); + final graphic = FlxG.bitmap.create(50, 50, 0x0, false, "logo-50x50"); + mat.scale(graphic.width / logo.width, graphic.height / logo.height); + graphic.bitmap.draw(logo, mat); + } } enum GaugeGraphic { SHAPE(shape:FlxRadialGaugeShape, ?innerRadius:Int); ASSET(asset:FlxGraphicAsset); - MAKE; } diff --git a/Features/FlxPieDial/source/Main.hx b/Features/FlxPieDial/source/Main.hx index 826e98865..b11508c22 100644 --- a/Features/FlxPieDial/source/Main.hx +++ b/Features/FlxPieDial/source/Main.hx @@ -9,10 +9,10 @@ class Main extends Sprite { super(); #if flash - addChild(new FlxGame(800, 500, DemoState)); + addChild(new FlxGame(800, 500, DemoState.new)); #else - addChild(new FlxGame(800, 500, GaugeState)); + // addChild(new FlxGame(800, 500, GaugeState.new)); + addChild(new FlxGame(800, 500, GaugeEditorState.new)); #end - } } From edf124c6b6d87ab47abdb7a986aec1b9ff85fc8a Mon Sep 17 00:00:00 2001 From: George FunBook Date: Tue, 1 Oct 2024 16:13:05 -0500 Subject: [PATCH 5/7] add square gauge remove old test --- .../FlxPieDial/source/GaugeEditorState.hx | 126 ++++++++------ Features/FlxPieDial/source/GaugeState.hx | 162 ------------------ Features/FlxPieDial/source/Main.hx | 3 +- .../source/{DemoState.hx => PieDIalState.hx} | 2 +- 4 files changed, 76 insertions(+), 217 deletions(-) delete mode 100644 Features/FlxPieDial/source/GaugeState.hx rename Features/FlxPieDial/source/{DemoState.hx => PieDIalState.hx} (98%) diff --git a/Features/FlxPieDial/source/GaugeEditorState.hx b/Features/FlxPieDial/source/GaugeEditorState.hx index 6c1744a60..9bcecb247 100644 --- a/Features/FlxPieDial/source/GaugeEditorState.hx +++ b/Features/FlxPieDial/source/GaugeEditorState.hx @@ -8,6 +8,7 @@ import flixel.math.FlxPoint; import flixel.tweens.FlxTween; import flixel.ui.FlxButton; import flixel.util.FlxColor; +import flixel.util.FlxSignal; using flixel.addons.display.FlxPieDial.FlxPieDialUtils; /** @@ -15,22 +16,29 @@ using flixel.addons.display.FlxPieDial.FlxPieDialUtils; */ class GaugeEditorState extends flixel.FlxState { - final shapeGauge:ShapeGaugeEditor; - final imageGaugeBg:FlxRadialGauge; - final imageGaugeFg:FlxRadialGauge; + final circleGauge:ShapeGaugeEditor; + final squareGauge:DoubleGauge; + final imageGauge:DoubleGauge; public function new () { super(); - shapeGauge = new ShapeGaugeEditor(FlxG.width / 3, FlxG.height * 0.5, CIRCLE, 100, 75, -225, 45); + circleGauge = new ShapeGaugeEditor(FlxG.width * 0.5, FlxG.height * 0.5, CIRCLE, 100, 75, -225, 45); + squareGauge = new DoubleGauge(); + squareGauge.makeShapeGraphic(SQUARE, 100, 75); + squareGauge.color = FlxColor.LIME; + squareGauge.back.color = FlxColor.BLACK; + circleGauge.onRedraw.add(function () + { + squareGauge.makeShapeGraphic(SQUARE, Math.round(circleGauge.radius), Math.round(circleGauge.innerRadius)); + }); drawLogo(); - imageGaugeBg = new FlxRadialGauge(FlxG.width * 2 / 3, FlxG.height * 0.5, "logo-200x200"); - imageGaugeBg.x -= imageGaugeBg.width * 0.5; - imageGaugeBg.y -= imageGaugeBg.height * 0.5; - imageGaugeBg.color = 0xFF909090; - imageGaugeFg = new FlxRadialGauge(imageGaugeBg.x, imageGaugeBg.y, "logo-200x200"); + imageGauge = new DoubleGauge(FlxG.width * 0.5, FlxG.height * 0.5, "logo-200x200"); + imageGauge.x -= imageGauge.width; + imageGauge.y -= imageGauge.height * 0.5; + imageGauge.back.color = 0xFF909090; } function drawLogo() @@ -48,24 +56,53 @@ class GaugeEditorState extends flixel.FlxState super.create(); bgColor = FlxColor.GRAY; - add(shapeGauge); - add(imageGaugeBg); - add(imageGaugeFg); + add(circleGauge); + add(squareGauge); + add(imageGauge); } override function draw() { - imageGaugeFg.amount = shapeGauge.getAmount(); - imageGaugeFg.start = imageGaugeBg.start = shapeGauge.getStart(); - imageGaugeFg.end = imageGaugeBg.end = shapeGauge.getEnd(); - final scale = 2 * shapeGauge.radius / imageGaugeBg.frameWidth; - imageGaugeBg.scale.set(scale, scale); - imageGaugeFg.scale.set(scale, scale); + squareGauge.amount = imageGauge.amount = circleGauge.getAmount(); + squareGauge.start = imageGauge.start = circleGauge.getStart(); + squareGauge.end = imageGauge.end = circleGauge.getEnd(); + final scale = 2 * circleGauge.radius / imageGauge.frameWidth; + imageGauge.scale.set(scale, scale); + imageGauge.updateHitbox(); + + squareGauge.x = circleGauge.x - circleGauge.radius * 3 - 10; + imageGauge.x = circleGauge.x + circleGauge.radius + 10; + imageGauge.y = squareGauge.y = circleGauge.y - circleGauge.radius; + + super.draw(); + } +} + +class DoubleGauge extends FlxRadialGauge +{ + public final back:FlxRadialGauge; + public function new (x = 0.0, y = 0.0, ?graphic) + { + back = new FlxRadialGauge(x, y, graphic); + super(x, y, graphic); + } + + override function draw() + { + back.x = x; + back.y = y; + back.frames = frames; + back.start = start; + back.end = end; + back.scale.copyFrom(scale); + back.updateHitbox(); + back.draw(); super.draw(); } } + /** * A visual editor for a FlxRadialGauge, has draggable objects that determine the gauge's properties */ @@ -74,12 +111,11 @@ class ShapeGaugeEditor extends flixel.group.FlxSpriteGroup public var shape:FlxRadialGaugeShape; public var radius = 0.0; public var innerRadius = 0.0; + public var onRedraw = new FlxSignal(); - final gaugeBg:FlxRadialGauge; - final gaugeFg:FlxRadialGauge; + final gauge:DoubleGauge; final radiusHandle:DragHandle; final innerRadiusHandle:DragHandle; - final shapeBtn:FlxButton; public function new (x = 0.0, y = 0.0, shape = CIRCLE, radius:Int, innerRadius:Int, start:Float, end:Float) { @@ -88,11 +124,9 @@ class ShapeGaugeEditor extends flixel.group.FlxSpriteGroup this.innerRadius = innerRadius; super(0, 0); - add(gaugeBg = new FlxRadialGauge(-radius, -radius)); - gaugeBg.color = FlxColor.BLACK; - - add(gaugeFg = new FlxRadialGauge(-radius, -radius)); - gaugeFg.color = FlxColor.LIME; + add(gauge = new DoubleGauge(-radius, -radius)); + gauge.back.color = FlxColor.BLACK; + gauge.color = FlxColor.LIME; // Helper point final pos = FlxPoint.get(); @@ -100,25 +134,15 @@ class ShapeGaugeEditor extends flixel.group.FlxSpriteGroup add(radiusHandle = new DragHandle(pos.x, pos.y, onRadiusChange)); pos.setPolarDegrees(innerRadius, end); add(innerRadiusHandle = new DragHandle(pos.x, pos.y, onInnerRadiusChange)); - shapeBtn = new FlxButton(0, 0, '${shape.getName()}', function () - { - this.shape = (this.shape == SQUARE ? CIRCLE : SQUARE); - shapeBtn.text = '${this.shape.getName()}'; - redraw(); - }); - add(shapeBtn); - shapeBtn.x -= shapeBtn.width * 0.5; - shapeBtn.y -= shapeBtn.height * 0.5; redraw(); - gaugeBg.setOrientation(start, end); - gaugeFg.setOrientation(start, end); + gauge.setOrientation(start, end); FlxTween.num(-0.1, 1.1, 2.0, {type: PINGPONG}, function (n) { final n = Math.min(1.0, Math.max(0.0, n)); - gaugeFg.amount = n; + gauge.amount = n; }); // Setting position after everything is added makes it easier to use relative positioning @@ -127,20 +151,18 @@ class ShapeGaugeEditor extends flixel.group.FlxSpriteGroup pos.put(); #if debug - FlxG.watch.addFunction("shape", ()->shape); FlxG.watch.addFunction("radius", ()->radius); FlxG.watch.addFunction("innerRadius", ()->innerRadius); - FlxG.watch.addFunction("start", ()->gaugeBg.start); - FlxG.watch.addFunction("end", ()->gaugeBg.end); - FlxG.watch.addFunction("amount", ()->gaugeFg.amount); + FlxG.watch.addFunction("start", ()->gauge.start); + FlxG.watch.addFunction("end", ()->gauge.end); + FlxG.watch.addFunction("amount", ()->gauge.amount); #end } inline function redraw() { - trace(shape); - gaugeBg.makeShapeGraphic(shape, Math.round(radius), Math.round(innerRadius)); - gaugeFg.makeShapeGraphic(shape, Math.round(radius), Math.round(innerRadius)); + gauge.makeShapeGraphic(shape, Math.round(radius), Math.round(innerRadius)); + onRedraw.dispatch(); } function onRadiusChange() @@ -148,9 +170,9 @@ class ShapeGaugeEditor extends flixel.group.FlxSpriteGroup final dis = FlxPoint.get(radiusHandle.x - x, radiusHandle.y - y); radius = dis.length; redraw(); - gaugeFg.x = gaugeBg.x = x - radius; - gaugeFg.y = gaugeBg.y = y - radius; - gaugeFg.start = gaugeBg.start = validateAngle(dis.degrees); + gauge.x = x - radius; + gauge.y = y - radius; + gauge.start = validateAngle(dis.degrees); dis.put(); } @@ -159,7 +181,7 @@ class ShapeGaugeEditor extends flixel.group.FlxSpriteGroup final dis = FlxPoint.get(innerRadiusHandle.x - x, innerRadiusHandle.y - y); innerRadius = dis.length; redraw(); - gaugeFg.end = gaugeBg.end = validateAngle(dis.degrees); + gauge.end = validateAngle(dis.degrees); dis.put(); } @@ -171,17 +193,17 @@ class ShapeGaugeEditor extends flixel.group.FlxSpriteGroup inline public function getStart() { - return gaugeBg.start; + return gauge.start; } inline public function getEnd() { - return gaugeBg.end; + return gauge.end; } inline public function getAmount() { - return gaugeFg.amount; + return gauge.amount; } } diff --git a/Features/FlxPieDial/source/GaugeState.hx b/Features/FlxPieDial/source/GaugeState.hx deleted file mode 100644 index c725dd09c..000000000 --- a/Features/FlxPieDial/source/GaugeState.hx +++ /dev/null @@ -1,162 +0,0 @@ -package; - -import flixel.FlxG; -import flixel.FlxState; -import flixel.addons.display.FlxRadialGauge; -import flixel.group.FlxGroup; -import flixel.system.FlxAssets; -import flixel.tweens.FlxTween; -import flixel.util.FlxColor; -import openfl.geom.Rectangle; - -/** - * Demo for the soon to be added feature, FlxRadialGauge. Will replace FlxPieDial and this demo - */ -class GaugeState extends FlxState -{ - override public function create():Void - { - super.create(); - FlxG.cameras.bgColor = FlxColor.GRAY; - - makeGraphics(); - - final colors = [FlxColor.RED, FlxColor.BLUE, FlxColor.LIME, FlxColor.WHITE, FlxColor.YELLOW, FlxColor.MAGENTA]; - final spacingX = 66; - final spacingY = 71; - final setSize = colors.length; - - inline function makeStaticShapeGauge(x, y, color:FlxColor, shape:FlxRadialGaugeShape, clockwise = true, innerRadius:Int, amount:Float) - { - final gauge = new FlxRadialGauge(x, y); - gauge.makeShapeGraphic(shape, 25, innerRadius, color); - if (!clockwise) - { - gauge.setOrientation(270, -90); - } - gauge.amount = amount; - add(gauge); - return gauge; - } - - inline function makeStaticAssetGauge(x, y, graphic, clockwise = true, amount:Float, color = FlxColor.WHITE) - { - final gauge = new FlxRadialGauge(x, y, graphic); - gauge.color = color; - - if (!clockwise) - { - gauge.setOrientation(270, -90); - } - - gauge.amount = amount; - add(gauge); - return gauge; - } - - inline function makeStaticSet(x:Float, y, graphic:GaugeGraphic, clockwise = true) - { - switch (graphic) - { - case SHAPE(shape, innerRadius): - final innerRadius = innerRadius == null ? 0 : innerRadius; - for (i in 0...setSize) - makeStaticShapeGauge(x + i * spacingX, y, colors[i], shape, clockwise, innerRadius, (i+1) / setSize); - case ASSET(asset): - for (i in 0...setSize) - makeStaticAssetGauge(x + i * spacingX, y, asset, clockwise, (i+1) / setSize, colors[i]); - } - } - - var y = 10; - - inline function makeStaticRow(graphic:GaugeGraphic) - { - makeStaticSet(10, y, graphic, true); - makeStaticSet(spacingX * setSize + 10, y, graphic, false); - y += spacingY; - } - - makeStaticRow(SHAPE(CIRCLE)); - makeStaticRow(SHAPE(SQUARE)); - makeStaticRow(SHAPE(CIRCLE, 12)); - makeStaticRow(SHAPE(SQUARE, 12)); - makeStaticRow(ASSET("logo-50x50")); - makeStaticRow(ASSET("square-50x50")); - - var x = 10; - final tweened = new FlxTypedGroup(); - inline function makeTweened(graphic:GaugeGraphic, clockwise = true, color = FlxColor.WHITE) - { - final gauge = switch (graphic) - { - case SHAPE(shape, innerRadius): - final gauge = new FlxRadialGauge(x, y); - gauge.makeShapeGraphic(shape, 25, innerRadius, color); - gauge; - case ASSET(asset): - final gauge = new FlxRadialGauge(x, y, asset); - gauge.color = color; - gauge; - } - - if (!clockwise) - { - gauge.setOrientation(270, -90); - } - - tweened.add(gauge); - x += spacingX; - - return gauge; - } - add(tweened); - - // clockwise - makeTweened(SHAPE(CIRCLE, 0 ), true, colors[0]); - makeTweened(SHAPE(CIRCLE, 10), true, colors[1]); - makeTweened(SHAPE(SQUARE, 0 ), true, colors[2]); - makeTweened(SHAPE(SQUARE, 10), true, colors[3]); - makeTweened(ASSET("logo-50x50"), true); - makeTweened(ASSET("square-50x50"), true, colors[5]); - // counter-clockwise - makeTweened(SHAPE(CIRCLE, 0 ), false, colors[0]); - makeTweened(SHAPE(CIRCLE, 10), false, colors[1]); - makeTweened(SHAPE(SQUARE, 0 ), false, colors[2]); - makeTweened(SHAPE(SQUARE, 10), false, colors[3]); - makeTweened(ASSET("logo-50x50"), false); - makeTweened(ASSET("square-50x50"), false, colors[5]); - - FlxTween.num(-0.1, 1.1, 2.0, {type: PINGPONG}, function (n) - { - final n = Math.min(1.0, Math.max(0.0, n)); - for (gauge in tweened) - gauge.amount = n; - - #if debug - FlxG.watch.addQuick("amount", n); - #end - }); - } - - function makeGraphics() - { - // Create outlined square - final graphic = FlxG.bitmap.create(50, 50, FlxColor.BLACK, true, "square-50x50"); - graphic.bitmap.fillRect(new Rectangle(2, 2, 46, 46), FlxColor.WHITE); - - // Create logo graphic - final logo = new openfl.display.Shape(); - flixel.system.FlxAssets.drawLogo(logo.graphics); - final mat = new flixel.math.FlxMatrix(); - final graphic = FlxG.bitmap.create(50, 50, 0x0, false, "logo-50x50"); - mat.scale(graphic.width / logo.width, graphic.height / logo.height); - graphic.bitmap.draw(logo, mat); - } -} - -enum GaugeGraphic -{ - SHAPE(shape:FlxRadialGaugeShape, ?innerRadius:Int); - ASSET(asset:FlxGraphicAsset); -} diff --git a/Features/FlxPieDial/source/Main.hx b/Features/FlxPieDial/source/Main.hx index b11508c22..d21ac99c2 100644 --- a/Features/FlxPieDial/source/Main.hx +++ b/Features/FlxPieDial/source/Main.hx @@ -9,9 +9,8 @@ class Main extends Sprite { super(); #if flash - addChild(new FlxGame(800, 500, DemoState.new)); + addChild(new FlxGame(800, 500, PieDialState.new)); #else - // addChild(new FlxGame(800, 500, GaugeState.new)); addChild(new FlxGame(800, 500, GaugeEditorState.new)); #end } diff --git a/Features/FlxPieDial/source/DemoState.hx b/Features/FlxPieDial/source/PieDIalState.hx similarity index 98% rename from Features/FlxPieDial/source/DemoState.hx rename to Features/FlxPieDial/source/PieDIalState.hx index 1ceba1fe8..00ae7060d 100644 --- a/Features/FlxPieDial/source/DemoState.hx +++ b/Features/FlxPieDial/source/PieDIalState.hx @@ -7,7 +7,7 @@ import flixel.group.FlxGroup; import flixel.tweens.FlxTween; import flixel.util.FlxColor; -class DemoState extends FlxState +class PieDialState extends FlxState { override public function create():Void { From c9947d6128f4482fdf930f0be639001c7dc968be Mon Sep 17 00:00:00 2001 From: George FunBook Date: Tue, 1 Oct 2024 16:58:21 -0500 Subject: [PATCH 6/7] rename 1 --- Features/FlxPieDial/source/{PieDIalState.hx => PieDialState2.hx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Features/FlxPieDial/source/{PieDIalState.hx => PieDialState2.hx} (100%) diff --git a/Features/FlxPieDial/source/PieDIalState.hx b/Features/FlxPieDial/source/PieDialState2.hx similarity index 100% rename from Features/FlxPieDial/source/PieDIalState.hx rename to Features/FlxPieDial/source/PieDialState2.hx From adba1e16ba4267accf2b557b33e6944e3280207a Mon Sep 17 00:00:00 2001 From: George FunBook Date: Tue, 1 Oct 2024 16:58:45 -0500 Subject: [PATCH 7/7] rename 2 (to fix capital letter) --- Features/FlxPieDial/source/{PieDialState2.hx => PieDialState.hx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Features/FlxPieDial/source/{PieDialState2.hx => PieDialState.hx} (100%) diff --git a/Features/FlxPieDial/source/PieDialState2.hx b/Features/FlxPieDial/source/PieDialState.hx similarity index 100% rename from Features/FlxPieDial/source/PieDialState2.hx rename to Features/FlxPieDial/source/PieDialState.hx