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 »

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
Veteran
Posts: 286
Joined: Thu Aug 31, 2017 11:47 am
Contact:

Re: Platform specific build settings

#2 Post by RicharDann »

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

Also you might want to look into Screen Variants.
The most important step is always the next one.

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

Re: Platform specific build settings

#3 Post by Imperf3kt »

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.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

Post Reply

Who is online

Users browsing this forum: Google [Bot]