Control element on screen

I’m trying to control elements on 2D screen, I’ve written a simple script for each png loaded as texture. It’s supposed to pop up like a sms and then disappear, 5 seconds later the next one pops up etc… But due to my script I control it pixel pr. frame and therefor it differs depending on which computer opens the project. Is there a way to control the position of my element on the screen so it will appear exactly the same no matter which device opens it?


Hi @linelineline,

If I understand correctly you want your 2D screens to be of the same size/scale on all devices?Check the manual page on how the reference resolution works together with the scale blend factor.

Setting it to 0.5 will make sure your elements stay the same size.

Thanks! I went to look and scale blend is already at 0.5. The issue is that I tell the png to move up fx. 90 and that distance is different depending on the computer used.

Unless every user has the same screen ratio, it’s not possible.

There are workarounds such as using the anchor points and doing movement relative to the anchor position. For example, anchoring an element to the right edge and then moving the element off the right of the screen will always work on every screen.

1 Like

I think it’s possible if you know the ratio of the screen with Window.devicePixelRatio

You will be able to multiply the speed in pixels.