[SOLVED] how to grab and manipulate renpy elements by their IDs
Posted: Sun Oct 30, 2022 1:36 am
Hello!
I'm having trouble finding docs on how to grab and manipulate elements by their IDs.
The parts I'm having trouble with are the ones I marked with ###
This is a simplified example code block that shows the relevant parts. I can't use manual solutions like having the other button already in place but hidden, etc.
In short, I haven't been able to find how to grab elements by their IDs, or how to manipulate them afterwards.
Thank you in advance for any help!
I'm having trouble finding docs on how to grab and manipulate elements by their IDs.
The parts I'm having trouble with are the ones I marked with ###
Code: Select all
init python:
def example_function(id_fixed, id_imagebutton, id_fixed_new):
###Delete imagebutton with id_imagebutton, and add new imagebutton to id_fixed_new
# OR, ALTERNATIVELY
###Move imagebutton with id_imagebutton to id_fixed_new, and change the id and action of imagebutton with id_imagebutton to a new id and action
label start:
screen my_example_screen:
fixed id "id_fixed":
imagebutton id "id_imagebutton":
#idle, hover, etc.
action example_function("id_fixed", "id_imagebutton", "id_fixed_new") #wanna move this button to fixed below, and change its id and action
fixed id "id_fixed_new":
#properties, style, whatever, etc.
show screen my_example_screen
This is a simplified example code block that shows the relevant parts. I can't use manual solutions like having the other button already in place but hidden, etc.
In short, I haven't been able to find how to grab elements by their IDs, or how to manipulate them afterwards.
Thank you in advance for any help!