Hello! I can rotate an object on the screen using ...
# getting-started
k
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
What graphical framework are you using?
k
I'm using Compose for Desktop.
s
there seems to be a #compose-desktop channel here on slack that might be a better place to ask.
k
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.