0
How do I keep objects in fixed position when window is resized?
Hello I am new to Ruby. Right now I am in the process of making a simple ping pong game using the Ruby2D to the library. My question is how do I make the two objects that are in my coat so far how do I keep them in this fixed position when I resize my window on the computer? https://code.sololearn.com/c7QaR5c8wMJu/?ref=app
1 Odpowiedź
0
I dont understand ruby but you can try,
Have the coords on screen, then convert them to location in window with basic math.
Ex.
OnScreen:
x = 1080
y = 720
OnWindow:
x-windowlocationx
y-windowlocationy