Code: Select all
renpy.variant('mobile') or renpy.variant('touch')
will return true for tablets but not TV consoles (and also the mobile check in that is redundant and should be removed, since I don't know of any mobile phone that isn't also a touchscreen device).
will return true for TV consoles (since screen elements need to be enlarged for visibility from further away) but not tablets (which are viewed as medium-sized screens).
Chances are you aren't targeting TV consoles, but if you're targeting mobile putting some thought into whether you really mean small screens or touch screens can improve the experience of anyone who installs your game on a tablet and is a good habit.
Code: Select all
renpy.variant('pc') or renpy.variant('web')
returns true on mobile browsers, so if what you really mean is not a mobile phone you should be using not small or not touch depending on which is more relevant.
A lot of the time you want to check for small (since a lot needs to change to accommodate smaller screens), but there might be cases where you want to, say, increase button borders on touch screens (which should affect tablets but is unnecessary for TVs) so you check for touch, or where you want to add buttons like "quit" that only make sense on PC so you check for pc.
A check like
Code: Select all
renpy.variant("pc") or (renpy.variant("web") and not renpy.variant("mobile"))
might also occasionally be helpful to guess if the player can use a keyboard/mouse setup, as happens in the default UI in deciding whether to show the default help screen (which assumes keyboard/mouse are available to the player and doesn't make sense on platforms where that's not generally true). This is likely only rarely useful though, most of the time you shouldn't need and/or statements.
https://www.renpy.org/doc/html/screens. ... n-variants explains all the variants so you can better understand which applies when.