Auto- scaling ALL sizes (fonts, images, aspect ratios).

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
tohtamish
Regular
Posts: 64
Joined: Thu Apr 29, 2010 4:56 am
Contact:

Auto- scaling ALL sizes (fonts, images, aspect ratios).

#1 Post by tohtamish » Wed Jan 25, 2017 2:22 pm

Hello all,

can anybody remind me how to get system variable of screen size and define all game vars according to that? For example positions of displaying images like 1/3 of screen height and 1/3 of screen width (game window screen both for windowed and fullcreen mode). I mean setting all X's and Y's like: 0.3*max_X, 0.3*max_Y. Where are they, those vars and what are the functions for them?

Thanks!

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Auto- scaling ALL sizes (fonts, images, aspect ratios).

#2 Post by Alex » Wed Jan 25, 2017 4:05 pm

You can set relative positions like

Code: Select all

pos (0.3, 0.5)
align (0.5, 0.5)
https://www.renpy.org/doc/html/style_pr ... perty-xpos

The game resolution is set by config.screen_height and config.screen_width variables (https://www.renpy.org/doc/html/config.h ... een_height), so one can use them like

Code: Select all

$ x = config.screen_height / 2
Also, you can get the phisical size of game window in pixels - https://www.renpy.org/doc/html/other.ht ... sical_size

User avatar
Taleweaver
Writing Maniac
Posts: 3428
Joined: Tue Nov 11, 2003 8:51 am
Completed: Metropolitan Blues, The Loyal Kinsman, Daemonophilia, The Dreaming, The Thirteenth Year, Adrift, Bionic Heart 2, Secrets of the Wolf, The Photographer
Projects: The Pilgrim's Path, Elspeth's Garden, Secret Adventure Game!
Organization: Tall Tales Productions
Location: Germany
Contact:

Re: Auto- scaling ALL sizes (fonts, images, aspect ratios).

#3 Post by Taleweaver » Thu Jan 26, 2017 6:38 am

Ren'Py question. Moved to the appropriate forum.
Scriptwriter and producer of Metropolitan Blues
Creator of The Loyal Kinsman
Scriptwriter and director of Daemonophilia
Scriptwriter and director of The Dreaming
Scriptwriter of Zenith Chronicles
Scriptwriter and director of The Thirteenth Year
Scriptwriter and director of Romance is Dead
Scriptwriter and producer of Adrift
More about me in my blog
"Adrift - Like Ever17, but without the Deus Ex Machina" - HigurashiKira

User avatar
tohtamish
Regular
Posts: 64
Joined: Thu Apr 29, 2010 4:56 am
Contact:

Re: Auto- scaling ALL sizes (fonts, images, aspect ratios).

#4 Post by tohtamish » Fri Jan 27, 2017 2:38 pm

Thanks, but how about font size? If game runs on big screens - how can I increase it automatically?

User avatar
Alex
Lemma-Class Veteran
Posts: 2981
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Auto- scaling ALL sizes (fonts, images, aspect ratios).

#5 Post by Alex » Fri Jan 27, 2017 2:49 pm

Actually, all you need is to set game resolution and use appropriate font size and images - if player runs the game on a big screen it will be automatically scaled up.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]