Platform specific build settings

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
unsatiable
Newbie
Posts: 2
Joined: Thu Nov 16, 2017 1:25 pm
Contact:

Platform specific build settings

#1 Post by unsatiable » Thu Nov 16, 2017 1:38 pm

Is there any way of having different settings defined for different build platforms? For example if I wanted to increase button size only on my android build without manually changing variables between builds.

ex:

Code: Select all

if build_platform == "Android":
    define gui.button_height = 70
else:
    define gui.button_height = 36
Thanks for any help

User avatar
RicharDann
Regular
Posts: 105
Joined: Thu Aug 31, 2017 11:47 am
Projects: A Fantasy-SciFi VN-RPG, doesn't have a (decent) title yet
Contact:

Re: Platform specific build settings

#2 Post by RicharDann » Thu Nov 16, 2017 1:47 pm

There are Platform detection functions to check what platform is currently being used.

Also you might want to look into Screen Variants.

User avatar
Imperf3kt
Eileen-Class Veteran
Posts: 1039
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Platform specific build settings

#3 Post by Imperf3kt » Thu Nov 16, 2017 3:00 pm

Yes you can do that but you might need to use it differently.

I haven't got enough time to give you an example, sorry.
The link above should help though.
A very quick idea would be the following:

if renpy.variant("pc"):
else:

I imagine you need to define both sizes and then select between the two via the styling property of each screen.
Image

Warning: May contain trace amounts of gratuitous plot.

Post Reply

Who is online

Users browsing this forum: [Admin-C], Baidu [Spider], sculpteur