How do I keep objects in fixed position when window is resized? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

27th Apr 2021, 3:07 PM
Bheki Fuzwayo
Bheki Fuzwayo - avatar
1 Answer
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
19th May 2021, 2:11 PM
Bhavik Mahalle
Bhavik Mahalle - avatar