user
10/22/2020, 3:50 PMbright-gpu-74537
10/22/2020, 3:51 PMbright-gpu-74537
10/22/2020, 3:51 PMbright-gpu-74537
10/22/2020, 4:05 PMbright-gpu-74537
10/22/2020, 4:06 PMxml
<vbox id="testBox" width="200">
<frame text="Drag me!" width="100%">
<vbox width="100%">
<hbox width="100%">
<button text="Button" width="50%" />
<button text="Button" width="50%" />
</hbox>
<vbox width="100%">
<button text="Button" width="100%" />
<button text="Button" width="100%" />
<button text="Button" width="100%" />
</vbox>
<hbox width="100%">
<button text="Button" width="33%" />
<button text="Button" width="34%" />
<button text="Button" width="33%" />
</hbox>
</vbox>
</frame>
</vbox>bright-gpu-74537
10/22/2020, 4:06 PMhaxe
_testBox = mainView.findComponent("testBox", Box);
_testBox.registerEvent(MouseEvent.MOUSE_DOWN, onMouseDown);
...
...
...
private static var _offset:Point = null;
private static function onMouseDown(e:MouseEvent) {
_offset = new Point(e.screenX - _testBox.screenLeft, e.screenY - _testBox.screenTop);
Screen.instance.registerEvent(MouseEvent.MOUSE_MOVE, onScreenMouseMove);
Screen.instance.registerEvent(MouseEvent.MOUSE_UP, onScreenMouseUp);
}
private static function onScreenMouseMove(e:MouseEvent) {
var x = e.screenX - _offset.x;
var y = e.screenY - _offset.y;
_testBox.left = x;
_testBox.top = y;
}
private static function onScreenMouseUp(e:MouseEvent) {
_offset = null;
Screen.instance.unregisterEvent(MouseEvent.MOUSE_MOVE, onScreenMouseMove);
Screen.instance.unregisterEvent(MouseEvent.MOUSE_UP, onScreenMouseUp);
}bright-gpu-74537
10/22/2020, 4:07 PMhandsome-processor-40961
10/22/2020, 5:42 PMbright-gpu-74537
10/22/2020, 5:48 PMable-action-74275
10/22/2020, 5:50 PMable-action-74275
10/22/2020, 5:52 PMvar levelSprites:FlxTypedgroup<FlxSprite>;
var entitySprites:FlxTypedgroup<FlxSprite>;
var ui:FlxTypedGroup<WhateverTheHaxeUiComponentTypeIs>;able-action-74275
10/22/2020, 5:53 PMhandsome-processor-40961
10/22/2020, 5:54 PMable-action-74275
10/22/2020, 5:54 PMbright-gpu-74537
10/22/2020, 5:54 PMbright-gpu-74537
10/22/2020, 5:54 PMhandsome-processor-40961
10/22/2020, 5:55 PMable-action-74275
10/22/2020, 5:55 PMbright-gpu-74537
10/22/2020, 5:55 PMhandsome-processor-40961
10/22/2020, 5:56 PMbright-gpu-74537
10/22/2020, 5:56 PMhandsome-processor-40961
10/22/2020, 5:56 PMable-action-74275
10/22/2020, 5:56 PMable-action-74275
10/22/2020, 5:57 PMhandsome-processor-40961
10/22/2020, 5:57 PMhandsome-processor-40961
10/22/2020, 5:57 PMhandsome-processor-40961
10/22/2020, 5:58 PMbright-gpu-74537
10/22/2020, 5:59 PMbright-gpu-74537
10/22/2020, 5:59 PMable-action-74275
10/22/2020, 5:59 PM