Chantajista You might be thinking about how screens and UI elements work in a way that is not consistent with how renpy is designed. You can't "get a reference" to an element, and then manipulate it's properties directly or via method calls.
Renpy's system grew out of it's roots - a way to show custom UI screens in visual novels. It was not designed to be a general purpose UI builder (although skilled users can achieve amazing things), and it does not have programmatically assigned callbacks or the ability to attach event handlers that listen to events.
The UI Elements are assembled in a screen to define the structure of the page.
Each element has "style properties". These properties can be set "inline" in the screen, or can be applied by "style" definitions. You can think of it being a bit like HTML and CSS, but without the concepts of a DOM, Events, or Javascript to automate stuff.
Here is a quick example showing how you can use a screen local variable, an action, and an element "size" style which takes the value of the local variable, and this setup shows how you can change an element's properties dynamically upon user interaction.
Code:
screen text_size_demo():
default textsize=20
vbox:
align(0.5, 0.5)
pos(0.5, 0.5)
spacing 50
frame:
align(0.5, 0.5)
pos(0.5, 0.5)
padding(0.1, 0.1)
text "This is a text in a frame which takes it's size from it's children" size textsize
frame:
align(0.5, 0.5)
pos(0.5, 0.5)
padding(0.1, 0.1)
xysize(0.3, 0.2)
text "This is a text in a frame that has a fixed size" size textsize
frame:
align(0.5, 0.5)
pos(0.5, 0.5)
background Color("#AA5")
textbutton "Make text bigger (click me)":
text_color "#131"
action [SetScreenVariable("textsize", textsize + 1)]
You might notice that i'm repeating some "align", "pos" etc. statements over and over - this is a perfect example of where it would be good to use a defined style and apply it to multiple elements, with style_prefix (
You must be registered to see the links
)