I have some basic issues with some of my code knowledges:
Editing file -> screens.rpy created the next stuff:
Code: Select all
init python:
def apm_dragged(drags, drop):
drags[0].set_child("tri_inner.png")
if not drop:
return
return True
screen mechs():
tag menu
modal False
draggroup:
id "apm"
drag:
align (0.5,0.97)
drag_name "apm_1"
child "apm_space_test"
droppable False
dragged apm_dragged
drag:
align (0.3,0.5)
drag_name "bed"
child "tri_border.png"
draggable False
I thought i could this by calling "set_child" drag's (function/statement/action/whatever...). I'm not sure if this will actually change the displayble's sprite as i intend to but i am posting this here because i just cant seem to understand how these statements should be called...
According to documentation:
Code: Select all
set_child(d)
Changes the child of this drag to d.
the big problem now its that i can't figure out what "d" should be...
calling drags[0].set_child("tri_inner.png") returns basicly: AttributeError: 'unicode' object has no attribute 'per_interact'
My guess is that when you create a "displayable" in this case a "drag" and declare child "IMAGE/path" this "child" attribute its not actually simply storing sprite source path, but its actually loading an object of some sort or "styles".... i don't know... i'm very frustrated...
QUESTIONS:
1) could someone give an example of proper usage of "set_child statement"
2) set_child will do the job of changing a draggable (or displayable) 's sprite?
3) if number 2 is False, any suggestion how to approach it?
4) am i just too stupid to learn this engine, or the documentation its actually not very helpful?
Thanks in advance...