new drag
This commit is contained in:
@@ -278,18 +278,8 @@ class CharacterEditor extends UIState {
|
||||
closeCurrentContextMenu();
|
||||
openContextMenu(topMenu[2].childs);
|
||||
}
|
||||
|
||||
if (FlxG.mouse.justPressed) {
|
||||
FlxG.mouse.getScreenPosition(charCamera, camDrag);
|
||||
camDrag *= camDragSpeed;
|
||||
camDrag += charCamera.scroll;
|
||||
}
|
||||
|
||||
if (FlxG.mouse.pressed) {
|
||||
var pos = FlxG.mouse.getScreenPosition(charCamera);
|
||||
pos *= camDragSpeed;
|
||||
nextScroll.set((camDrag.x - pos.x), (camDrag.y - pos.y));
|
||||
|
||||
nextScroll.set(nextScroll.x - FlxG.mouse.deltaScreenX, nextScroll.y - FlxG.mouse.deltaScreenY);
|
||||
currentCursor = HAND;
|
||||
} else
|
||||
currentCursor = ARROW;
|
||||
|
||||
@@ -104,7 +104,7 @@ class UIButtonList<T:UIButton> extends UIWindow {
|
||||
|
||||
super.update(elapsed);
|
||||
|
||||
nextscrollY = FlxMath.bound(buttonCameras.scroll.y - (hovered ? FlxG.mouse.wheel : 0) * 6, -buttonSpacing, Math.max((addButton.y + 32 + (buttonSpacing*1.5)) - buttonCameras.height, -buttonSpacing));
|
||||
nextscrollY = FlxMath.bound(buttonCameras.scroll.y - (hovered ? FlxG.mouse.wheel : 0) * 12, -buttonSpacing, Math.max((addButton.y + 32 + (buttonSpacing*1.5)) - buttonCameras.height, -buttonSpacing));
|
||||
|
||||
if (curMoving != null && dragging) {
|
||||
nextscrollY -= Math.min((bHeight - 100) - FlxG.mouse.getWorldPosition(buttonCameras).y, 0) / 8;
|
||||
|
||||
Reference in New Issue
Block a user