Replies: 1 comment 1 reply
-
Found this GLFW C code in SO, but it uses the callbacks for GLFW mouse movement and mouse button pressed to set the variables, translating it into Ebiten gives me the same jumpy results. func (g *Game) Update() error {
// Ebiten automatically calls this function every frame
if ebiten.IsMouseButtonPressed(ebiten.MouseButton0) {
x, y := ebiten.CursorPosition()
deltaX := x - mouseX
deltaY := y - mouseY
winX, winY := ebiten.WindowPosition()
ebiten.SetWindowPosition(winX+deltaX, winY+deltaY)
}
mouseX, mouseY = ebiten.CursorPosition()
return nil
} This is my current code, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a small widget app with
SetWindowFloating(true)
andSetWindowDecorated(true)
. What is the most efficient way to drag the window around?I tried detecting a mouse click on the
Update()
and using a delta of movement to useWindowPosition()
andSetWindowPosition()
, but it is very slow and sluggish (jumpy), reducing the TPS makes it a little bit better, but not smooth. Is there any other approach, solution?Beta Was this translation helpful? Give feedback.
All reactions