Change Theme Quickly

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
James_Bytes
Newbie
Posts: 3
Joined: Thu Jan 14, 2021 1:54 am
Contact:

Change Theme Quickly

#1 Post by James_Bytes »

This is how I configured my GUI in Renpy with If statements.

anywhere(only tested in screens.rpy though):

Code: Select all

init python: 
    mytheme= "normal" 
in script.rpy:

Code: Select all

$mytheme ="activated"
what you want to change

Code: Select all

if mytheme =="activated": 
	(new code here) 
else: 
	(old code here) 
or

Code: Select all

(old code here) 
if mytheme =="activated": 
	(new code here) 
Examples (gui.rpy) :

Code: Select all

## Main and Game Menus #########################################################

## The images used for the main and game menus.

if mytheme =="activated": 
    define gui.main_menu_background = "gui/newimage.jpg"
    define gui.game_menu_background = "gui/newimage.jpg"
else:
    define gui.main_menu_background = "gui/oldimage.jpg"
    define gui.game_menu_background = "gui/oldimage.jpg"

Code: Select all

################################################################################
## GUI Configuration Variables
################################################################################


## Colors ######################################################################
##
## The colors of text in the interface.

## An accent color used throughout the interface to label and highlight text.
define gui.accent_color = u'#a28351'
if mytheme =="activated": 
    define gui.accent_color = u'#89de00'
Hope this helps someone out there. <3

-JB
Building The Life Game at https://thelifega.me. An android and ios app focused on helping the user make life decisions.

Post Reply

Who is online

Users browsing this forum: No registered users