Adapting graphics to different screen sizes

How do I change the graphics depending on the screen size? Because after reading the guides provided by you guys at DeFold, I am still unsure as to how I do this. What do I need to send to the render script? Or what do I need to change in the render script itself?

When you say change the graphics do mean using a different asset size depending on the screen resolution (like iOS/Mac with their retina display)? Or do you mean simply adapting to different screen sizes?

In the last case you can send a message to the render script

msg.post("@render:", "use_fixed_fit_projection")

There’s also a sample project here:

3 Likes

I mean the latter but it doesn’t work, as I don’t know where I need to put that line of code.

DId you checkout the sample project ?

If you create a new project and use the Desktop game template, that is already set for you.
In the main.script you’ll see that it is in the init function.

1 Like

(pro tip: use code blocks to insert text. That way users can search the forum for the text!)

3 Likes