https://kotlinlang.org logo
Title
k

Kebbin

01/18/2022, 11:59 AM
Hello! I can rotate an object on the screen using the mouse location and the
atan2
function. As soon as I begin the rotation, the object jumps to point at the mouse location (rotation angle follows mouse angle), but I want to be able to rotate the object relative to the mouse angle. I can measure the difference between the current rotation, and the mouse angle when the rotation begins, but I cant make the
diff
value remain constant during the rotation!
I need to learn how you set a value once from other variables without it then constantly updating itself. Can someone show me how? Thanks!
s

Stephan Schroeder

01/18/2022, 1:20 PM
What graphical framework are you using?
k

Kebbin

01/18/2022, 1:29 PM
I'm using Compose for Desktop.
s

Stephan Schroeder

01/26/2022, 1:18 PM
there seems to be a #compose-desktop channel here on slack that might be a better place to ask.
k

Kebbin

01/27/2022, 2:27 AM
I really just need to know how to set a variable once from other variables, then have it become temporarily read-only, so it doesn't continuously recalculate itself based on the other variables changing. This needs to happen regularly, not just once on app startup for example.