Skip to content

Commit

Permalink
vpad update (x postioning needed)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 committed Apr 16, 2024
1 parent d900ac0 commit 694425f
Show file tree
Hide file tree
Showing 37 changed files with 77 additions and 90 deletions.
Binary file modified assets/images/mobile/virtualpad/a.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/e.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/f.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/g.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/h.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/i.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/j.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/k.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/l.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/o.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/p.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/q.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/r.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/s.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/t.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/mobile/virtualpad/u.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/mobile/virtualpad/up.png
Binary file modified assets/images/mobile/virtualpad/v.png
Binary file added assets/images/mobile/virtualpad/w.png
Binary file modified assets/images/mobile/virtualpad/x.png
Binary file modified assets/images/mobile/virtualpad/y.png
Binary file modified assets/images/mobile/virtualpad/z.png
1 change: 0 additions & 1 deletion source/funkin/backend/chart/Chart.hx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ class Chart {
}
}
}
trace(data);
return data;
}

Expand Down
8 changes: 0 additions & 8 deletions source/funkin/backend/system/Controls.hx
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,6 @@ class Controls extends FlxActionSet
case LEFT_RIGHT:
inline forEachBound(Control.LEFT, (action, state) -> addButtonUI(action, vpad.buttonLeft, state));
inline forEachBound(Control.RIGHT, (action, state) -> addButtonUI(action, vpad.buttonRight, state));
case UP_LEFT_RIGHT:
inline forEachBound(Control.UP, (action, state) -> addButtonUI(action, vpad.buttonUp, state));
inline forEachBound(Control.LEFT, (action, state) -> addButtonUI(action, vpad.buttonLeft, state));
inline forEachBound(Control.RIGHT, (action, state) -> addButtonUI(action, vpad.buttonRight, state));
case LEFT_FULL | RIGHT_FULL:
inline forEachBound(Control.UP, (action, state) -> addButtonUI(action, vpad.buttonUp, state));
inline forEachBound(Control.DOWN, (action, state) -> addButtonUI(action, vpad.buttonDown, state));
Expand Down Expand Up @@ -519,10 +515,6 @@ class Controls extends FlxActionSet
case LEFT_RIGHT:
inline forEachBound(Control.NOTE_LEFT, (action, state) -> addButtonNOTES(action, VirtualPad.buttonLeft, state));
inline forEachBound(Control.NOTE_RIGHT, (action, state) -> addButtonNOTES(action, VirtualPad.buttonRight, state));
case UP_LEFT_RIGHT:
inline forEachBound(Control.NOTE_UP, (action, state) -> addButtonNOTES(action, VirtualPad.buttonUp, state));
inline forEachBound(Control.NOTE_LEFT, (action, state) -> addButtonNOTES(action, VirtualPad.buttonLeft, state));
inline forEachBound(Control.NOTE_RIGHT, (action, state) -> addButtonNOTES(action, VirtualPad.buttonRight, state));
case LEFT_FULL | RIGHT_FULL:
inline forEachBound(Control.NOTE_UP, (action, state) -> addButtonNOTES(action, VirtualPad.buttonUp, state));
inline forEachBound(Control.NOTE_DOWN, (action, state) -> addButtonNOTES(action, VirtualPad.buttonDown, state));
Expand Down
6 changes: 6 additions & 0 deletions source/funkin/menus/MainMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ class MainMenuState extends MusicBeatState
});
}

override function closeSubState() {
super.closeSubState();
removeVirtualPad();
addVirtualPad('UP_DOWN', 'A_B_X_Y');
}

public override function switchTo(nextState:FlxState):Bool {
try {
menuItems.forEach(function(spr:FlxSprite) {
Expand Down
1 change: 0 additions & 1 deletion source/funkin/options/OptionsScreen.hx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class OptionsScreen extends FlxTypedSpriteGroup<OptionType> {
public function close() {
onClose(this);
if(prevVPadModes.length > 0){
trace(prevVPadModes);
MusicBeatState.instance.removeVirtualPad();
MusicBeatState.instance.addVirtualPad(prevVPadModes[0], prevVPadModes[1]);
MusicBeatState.instance.addVirtualPadCamera(false);
Expand Down
1 change: 0 additions & 1 deletion source/mobile/flixel/FlxButton.hx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,6 @@ class FlxTypedButton<T:FlxSprite> extends FlxSprite implements IFlxInput
super.graphicLoaded();

setupAnimation('normal', FlxButton.NORMAL);
setupAnimation('highlight', FlxButton.HIGHLIGHT);
setupAnimation('pressed', FlxButton.PRESSED);
}

Expand Down
150 changes: 71 additions & 79 deletions source/mobile/flixel/FlxVirtualPad.hx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ enum FlxDPadMode
{
UP_DOWN;
LEFT_RIGHT;
UP_LEFT_RIGHT;
LEFT_FULL;
RIGHT_FULL;
BOTH;
Expand Down Expand Up @@ -57,26 +56,39 @@ class FlxVirtualPad extends FlxButtonGroup
public var buttonUp:FlxButton = new FlxButton(0, 0);
public var buttonRight:FlxButton = new FlxButton(0, 0);
public var buttonDown:FlxButton = new FlxButton(0, 0);

public var buttonLeft2:FlxButton = new FlxButton(0, 0);
public var buttonUp2:FlxButton = new FlxButton(0, 0);
public var buttonRight2:FlxButton = new FlxButton(0, 0);
public var buttonDown2:FlxButton = new FlxButton(0, 0);

public var buttonA:FlxButton = new FlxButton(0, 0);
public var buttonB:FlxButton = new FlxButton(0, 0);
public var buttonP:FlxButton = new FlxButton(0, 0);
public var buttonC:FlxButton = new FlxButton(0, 0);
public var buttonD:FlxButton = new FlxButton(0, 0);
public var buttonE:FlxButton = new FlxButton(0, 0);
public var buttonF:FlxButton = new FlxButton(0, 0);
public var buttonG:FlxButton = new FlxButton(0, 0);
public var buttonH:FlxButton = new FlxButton(0, 0);
public var buttonI:FlxButton = new FlxButton(0, 0);
public var buttonJ:FlxButton = new FlxButton(0, 0);
public var buttonK:FlxButton = new FlxButton(0, 0);
public var buttonL:FlxButton = new FlxButton(0, 0);
public var buttonM:FlxButton = new FlxButton(0, 0);
public var buttonN:FlxButton = new FlxButton(0, 0);
public var buttonO:FlxButton = new FlxButton(0, 0);
public var buttonP:FlxButton = new FlxButton(0, 0);
public var buttonQ:FlxButton = new FlxButton(0, 0);
public var buttonR:FlxButton = new FlxButton(0, 0);
public var buttonS:FlxButton = new FlxButton(0, 0);
public var buttonT:FlxButton = new FlxButton(0, 0);
public var buttonU:FlxButton = new FlxButton(0, 0);
public var buttonV:FlxButton = new FlxButton(0, 0);
public var buttonW:FlxButton = new FlxButton(0, 0);
public var buttonX:FlxButton = new FlxButton(0, 0);
public var buttonY:FlxButton = new FlxButton(0, 0);
public var buttonZ:FlxButton = new FlxButton(0, 0);

public var curDPadMode:FlxDPadMode = NONE;
public var curActionMode:FlxActionMode = NONE;

public static var dpadModes:Map<String, FlxDPadMode>;
public static var actionModes:Map<String, FlxActionMode>;

Expand Down Expand Up @@ -106,83 +118,79 @@ class FlxVirtualPad extends FlxButtonGroup
switch (dpadMode)
{
case UP_DOWN:
add(buttonUp = createButton(0, FlxG.height - 255, 'up', 0x00FF00));
add(buttonDown = createButton(0, FlxG.height - 135, 'down', 0x00FFFF));
add(buttonUp = createButton(0, FlxG.height - 251, 'up', 0x00FF00));
add(buttonDown = createButton(0, FlxG.height - 131, 'down', 0x00FFFF));
case LEFT_RIGHT:
add(buttonLeft = createButton(0, FlxG.height - 135, 'left', 0xFF00FF));
add(buttonRight = createButton(127, FlxG.height - 135, 'right', 0xFF0000));
case UP_LEFT_RIGHT:
add(buttonUp = createButton(105, FlxG.height - 243, 'up', 0x00FF00));
add(buttonLeft = createButton(0, FlxG.height - 135, 'left', 0xFF00FF));
add(buttonRight = createButton(207, FlxG.height - 135, 'right', 0xFF0000));
add(buttonLeft = createButton(0, FlxG.height - 131, 'left', 0xFF00FF));
add(buttonRight = createButton(127, FlxG.height - 131, 'right', 0xFF0000));
case LEFT_FULL:
add(buttonUp = createButton(105, FlxG.height - 345, 'up', 0x00FF00));
add(buttonUp = createButton(105, FlxG.height - 341, 'up', 0x00FF00));
add(buttonLeft = createButton(0, FlxG.height - 243, 'left', 0xFF00FF));
add(buttonRight = createButton(207, FlxG.height - 243, 'right', 0xFF0000));
add(buttonDown = createButton(105, FlxG.height - 135, 'down', 0x00FFFF));
add(buttonDown = createButton(105, FlxG.height - 131, 'down', 0x00FFFF));
case RIGHT_FULL:
add(buttonUp = createButton(FlxG.width - 258, FlxG.height - 408, 'up', 0x00FF00));
add(buttonLeft = createButton(FlxG.width - 384, FlxG.height - 309, 'left', 0xFF00FF));
add(buttonRight = createButton(FlxG.width - 132, FlxG.height - 309, 'right', 0xFF0000));
add(buttonDown = createButton(FlxG.width - 258, FlxG.height - 201, 'down', 0x00FFFF));
add(buttonUp = createButton(FlxG.width - 258, FlxG.height - 404, 'up', 0x00FF00));
add(buttonLeft = createButton(FlxG.width - 384, FlxG.height - 305, 'left', 0xFF00FF));
add(buttonRight = createButton(FlxG.width - 132, FlxG.height - 305, 'right', 0xFF0000));
add(buttonDown = createButton(FlxG.width - 258, FlxG.height - 197, 'down', 0x00FFFF));
case BOTH:
add(buttonUp = createButton(105, FlxG.height - 345, 'up', 0x00FF00));
add(buttonUp = createButton(105, FlxG.height - 341, 'up', 0x00FF00));
add(buttonLeft = createButton(0, FlxG.height - 243, 'left', 0xFF00FF));
add(buttonRight = createButton(207, FlxG.height - 243, 'right', 0xFF0000));
add(buttonDown = createButton(105, FlxG.height - 135, 'down', 0x00FFFF));
add(buttonUp2 = createButton(FlxG.width - 258, FlxG.height - 408, 'up', 0x00FF00));
add(buttonLeft2 = createButton(FlxG.width - 384, FlxG.height - 309, 'left', 0xFF00FF));
add(buttonRight2 = createButton(FlxG.width - 132, FlxG.height - 309, 'right', 0xFF0000));
add(buttonDown2 = createButton(FlxG.width - 258, FlxG.height - 201, 'down', 0x00FFFF));
add(buttonDown = createButton(105, FlxG.height - 131, 'down', 0x00FFFF));
add(buttonUp2 = createButton(FlxG.width - 258, FlxG.height - 404, 'up', 0x00FF00));
add(buttonLeft2 = createButton(FlxG.width - 384, FlxG.height - 305, 'left', 0xFF00FF));
add(buttonRight2 = createButton(FlxG.width - 132, FlxG.height - 305, 'right', 0xFF0000));
add(buttonDown2 = createButton(FlxG.width - 258, FlxG.height - 197, 'down', 0xA100FFFF));
case NONE: // do nothing
}

switch (actionMode)
{
case A:
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 135, 'a', 0xFF0000));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 131, 'a', 0xFF0000));
case B:
add(buttonB = createButton(FlxG.width - 132, FlxG.height - 135, 'b', 0xFFCB00));
add(buttonB = createButton(FlxG.width - 132, FlxG.height - 131, 'b', 0xFFCB00));
case P:
add(buttonP = createButton(FlxG.width - 132, 0, 'x', 0x99062D));
add(buttonP = createButton(FlxG.width - 132, 0, 'p', 0xFFCB00));
case A_B:
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 135, 'b', 0xFFCB00));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 135, 'a', 0xFF0000));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 131, 'b', 0xFFCB00));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 131, 'a', 0xFF0000));
case A_B_C:
add(buttonC = createButton(FlxG.width - 384, FlxG.height - 135, 'c', 0x44FF00));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 135, 'b', 0xFFCB00));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 135, 'a', 0xFF0000));
add(buttonC = createButton(FlxG.width - 384, FlxG.height - 131, 'c', 0x44FF00));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 131, 'b', 0xFFCB00));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 131, 'a', 0xFF0000));
case A_B_E:
add(buttonE = createButton(FlxG.width - 384, FlxG.height - 135, 'e', 0xFF7D00));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 135, 'b', 0xFFCB00));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 135, 'a', 0xFF0000));
add(buttonE = createButton(FlxG.width - 384, FlxG.height - 131, 'e', 0xFF7D00));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 131, 'b', 0xFFCB00));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 131, 'a', 0xFF0000));
case A_B_X_Y:
add(buttonX = createButton(FlxG.width - 510, FlxG.height - 135, 'x', 0x99062D));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 135, 'b', 0xFFCB00));
add(buttonY = createButton(FlxG.width - 384, FlxG.height - 135, 'y', 0x4A35B9));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 135, 'a', 0xFF0000));
add(buttonX = createButton(FlxG.width - 510, FlxG.height - 131, 'x', 0x99062D));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 131, 'b', 0xFFCB00));
add(buttonY = createButton(FlxG.width - 384, FlxG.height - 131, 'y', 0x4A35B9));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 131, 'a', 0xFF0000));
case A_B_C_X_Y:
add(buttonC = createButton(FlxG.width - 384, FlxG.height - 135, 'c', 0x44FF00));
add(buttonX = createButton(FlxG.width - 258, FlxG.height - 255, 'x', 0x99062D));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 135, 'b', 0xFFCB00));
add(buttonY = createButton(FlxG.width - 132, FlxG.height - 255, 'y', 0x4A35B9));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 135, 'a', 0xFF0000));
add(buttonC = createButton(FlxG.width - 384, FlxG.height - 131, 'c', 0x44FF00));
add(buttonX = createButton(FlxG.width - 258, FlxG.height - 251, 'x', 0x99062D));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 131, 'b', 0xFFCB00));
add(buttonY = createButton(FlxG.width - 132, FlxG.height - 251, 'y', 0x4A35B9));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 131, 'a', 0xFF0000));
case A_B_C_X_Y_Z:
add(buttonX = createButton(FlxG.width - 384, FlxG.height - 255, 'x', 0x99062D));
add(buttonC = createButton(FlxG.width - 384, FlxG.height - 135, 'c', 0x44FF00));
add(buttonY = createButton(FlxG.width - 258, FlxG.height - 255, 'y', 0x4A35B9));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 135, 'b', 0xFFCB00));
add(buttonZ = createButton(FlxG.width - 132, FlxG.height - 255, 'z', 0xCCB98E));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 135, 'a', 0xFF0000));
add(buttonX = createButton(FlxG.width - 384, FlxG.height - 251, 'x', 0x99062D));
add(buttonC = createButton(FlxG.width - 384, FlxG.height - 131, 'c', 0x44FF00));
add(buttonY = createButton(FlxG.width - 258, FlxG.height - 251, 'y', 0x4A35B9));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 131, 'b', 0xFFCB00));
add(buttonZ = createButton(FlxG.width - 132, FlxG.height - 251, 'z', 0xCCB98E));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 131, 'a', 0xFF0000));
case A_B_C_D_V_X_Y_Z:
add(buttonV = createButton(FlxG.width - 510, FlxG.height - 255, 'v', 0x49A9B2));
add(buttonD = createButton(FlxG.width - 510, FlxG.height - 135, 'd', 0x0078FF));
add(buttonX = createButton(FlxG.width - 384, FlxG.height - 255, 'x', 0x99062D));
add(buttonC = createButton(FlxG.width - 384, FlxG.height - 135, 'c', 0x44FF00));
add(buttonY = createButton(FlxG.width - 258, FlxG.height - 255, 'y', 0x4A35B9));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 135, 'b', 0xFFCB00));
add(buttonZ = createButton(FlxG.width - 132, FlxG.height - 255, 'z', 0xCCB98E));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 135, 'a', 0xFF0000));
add(buttonV = createButton(FlxG.width - 510, FlxG.height - 251, 'v', 0x49A9B2));
add(buttonD = createButton(FlxG.width - 510, FlxG.height - 131, 'd', 0x0078FF));
add(buttonX = createButton(FlxG.width - 384, FlxG.height - 251, 'x', 0x99062D));
add(buttonC = createButton(FlxG.width - 384, FlxG.height - 131, 'c', 0x44FF00));
add(buttonY = createButton(FlxG.width - 258, FlxG.height - 251, 'y', 0x4A35B9));
add(buttonB = createButton(FlxG.width - 258, FlxG.height - 131, 'b', 0xFFCB00));
add(buttonZ = createButton(FlxG.width - 132, FlxG.height - 251, 'z', 0xCCB98E));
add(buttonA = createButton(FlxG.width - 132, FlxG.height - 131, 'a', 0xFF0000));
case NONE: // do nothing
}

Expand Down Expand Up @@ -217,26 +225,10 @@ class FlxVirtualPad extends FlxButtonGroup
override public function destroy():Void
{
super.destroy();
buttonLeft = FlxDestroyUtil.destroy(buttonLeft);
buttonUp = FlxDestroyUtil.destroy(buttonUp);
buttonDown = FlxDestroyUtil.destroy(buttonDown);
buttonRight = FlxDestroyUtil.destroy(buttonRight);

buttonLeft2 = FlxDestroyUtil.destroy(buttonLeft2);
buttonUp2 = FlxDestroyUtil.destroy(buttonUp2);
buttonDown2 = FlxDestroyUtil.destroy(buttonDown2);
buttonRight2 = FlxDestroyUtil.destroy(buttonRight2);

buttonA = FlxDestroyUtil.destroy(buttonA);
buttonB = FlxDestroyUtil.destroy(buttonB);
buttonP = FlxDestroyUtil.destroy(buttonP);
buttonC = FlxDestroyUtil.destroy(buttonC);
buttonD = FlxDestroyUtil.destroy(buttonD);
buttonE = FlxDestroyUtil.destroy(buttonE);
buttonV = FlxDestroyUtil.destroy(buttonV);
buttonX = FlxDestroyUtil.destroy(buttonX);
buttonY = FlxDestroyUtil.destroy(buttonY);
buttonZ = FlxDestroyUtil.destroy(buttonZ);
for (field in Reflect.fields(this))
if (Std.isOfType(Reflect.field(this, field), FlxButton))
Reflect.setField(this, field, FlxDestroyUtil.destroy(Reflect.field(this, field)));
}

private function createButton(X:Float, Y:Float, Graphic:String, Color:Int = 0xFFFFFF):FlxButton
Expand All @@ -253,7 +245,7 @@ class FlxVirtualPad extends FlxButtonGroup

var button:FlxButton = new FlxButton(X, Y);
try {
button.frames = FlxTileFrames.fromGraphic(graphic, FlxPoint.get(Std.int(graphic.width / 3), graphic.height));
button.frames = FlxTileFrames.fromGraphic(graphic, FlxPoint.get(Std.int(graphic.width / 2), graphic.height));
}
catch (e){
trace("Failed to create button(s) " + e.message);
Expand Down

0 comments on commit 694425f

Please sign in to comment.