From 78e205d60fd3076410f51cb66803eb58347913d8 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Fri, 4 Jun 2021 02:57:43 -0400 Subject: [PATCH] offset moving shit --- source/DebugBoundingState.hx | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/source/DebugBoundingState.hx b/source/DebugBoundingState.hx index 024ad35c9..4c1a577bc 100644 --- a/source/DebugBoundingState.hx +++ b/source/DebugBoundingState.hx @@ -215,6 +215,33 @@ class DebugBoundingState extends FlxState animDropDownMenu.selectedId = Std.string(Std.parseInt(animDropDownMenu.selectedId) - 1); animDropDownMenu.callback(animDropDownMenu.selectedId); } + + if (FlxG.keys.justPressed.RIGHT || FlxG.keys.justPressed.LEFT || FlxG.keys.justPressed.UP || FlxG.keys.justPressed.DOWN) + { + var animName = animDropDownMenu.selectedLabel; + var coolValues:Array = swagChar.animOffsets.get(animName); + + var multiplier:Float = 5; + + if (FlxG.keys.pressed.CONTROL) + multiplier = 1; + + if (FlxG.keys.pressed.SHIFT) + multiplier = 10; + + if (FlxG.keys.justPressed.RIGHT) + coolValues[0] -= 1 * multiplier; + else if (FlxG.keys.justPressed.LEFT) + coolValues[0] += 1 * multiplier; + else if (FlxG.keys.justPressed.UP) + coolValues[1] += 1 * multiplier; + else if (FlxG.keys.justPressed.DOWN) + coolValues[1] -= 1 * multiplier; + + swagChar.animOffsets.set(animDropDownMenu.selectedLabel, coolValues); + swagChar.playAnim(animName); + trace(animName); + } } var swagChar:Character; @@ -243,7 +270,10 @@ class DebugBoundingState extends FlxState animDropDownMenu.setData(FlxUIDropDownMenu.makeStrIdLabelArray(animThing, true)); animDropDownMenu.callback = function(str:String) { - swagChar.playAnim(animThing[Std.parseInt(str)]); // trace(); + var animName = animThing[Std.parseInt(str)]; + + swagChar.playAnim(animName); // trace(); + trace(swagChar.animOffsets.get(animName)); }; dropDownSetup = true; }