I want to be able to move a window around without having a title bar. Is this possible with lime or openfl? If I naively have a listener on mouse move update the position it doesn’t work right because of course the positions I get from mouse move are relative to the window.
class Main extends Sprite
{
var mouseDown:Bool = false;
public function new()
{
super();
stage.window.onMouseDown.add(function(_, _, mouseButton) {
if (mouseButton == MouseButton.LEFT) mouseDown = true;
});
stage.window.onMouseUp.add(function(_, _, mouseButton) {
if (mouseButton == MouseButton.LEFT) mouseDown = false;
});
stage.window.onMouseMove.add(function(_x:Float, _y:Float) {
if (mouseDown) {
trace('$_x,$_y');
stage.window.move(Std.int(x + _x), Std.int(y + _y));
// stage.window.move(Std.int(_x), Std.int(_y));
}
});
}
}