How to relocate an image once ADDed to a screen.
Posted: Sat Nov 18, 2017 2:54 am
I have a screen which has several images, added with...
How can I relocate them, changing the xpos and/or ypos? I "defined" them, in hopes that I could alter the attributes that way, but I am not having any luck getting them to move. Define is apparently just a "name" of the "path", not the actual image, located at the path.
I need them to move over to another location, to indicate the rooms they are in. (Not a transition, just a blunt relocation to new X,Y positions.)
Is there another way I should do this? I put them on a screen, so I can hide them when the dialogue displays and only show them when needed. There are many more icons and actual positions. This is simplified for this example only.
NOTE: Using this... will not work, giving errors... though it says ADD accepts images and displayables...
NameError: name "ico_you" is not defined
https://www.renpy.org/doc/html/screens.html#add
Can I do this something like how the dialogue-box ADDs an image...
add SideImage()
but, obviously... My code instead. Because, SideImage() is a built-in for RenPy, I think.
add MyImage()
I assume that I might be able to create a function that returns an image, with properties set, as the MyImage()... Not sure how to setup that, within a function, exactly.
Code: Select all
define ico_you = "ico/you.png"
define ico_her = "ico/her.png"
define ico_him = "ico/him.png"
screen myIcons:
zorder 10
fixed:
add ico_you xpos 100 ypos 300
add ico_her xpos 100 ypos 500
add ico_him xpos 100 ypos 700
I need them to move over to another location, to indicate the rooms they are in. (Not a transition, just a blunt relocation to new X,Y positions.)
Is there another way I should do this? I put them on a screen, so I can hide them when the dialogue displays and only show them when needed. There are many more icons and actual positions. This is simplified for this example only.
NOTE: Using this... will not work, giving errors... though it says ADD accepts images and displayables...
Code: Select all
image ico_you = "ico/you.png"
screen myIcons:
zorder 10
fixed:
add ico_you xpos 100 ypos 300
https://www.renpy.org/doc/html/screens.html#add
https://www.renpy.org/doc/html/displayables.html#imagesAdd
Adds an image or other displayable to the screen.
Can I do this something like how the dialogue-box ADDs an image...
add SideImage()
but, obviously... My code instead. Because, SideImage() is a built-in for RenPy, I think.
add MyImage()
I assume that I might be able to create a function that returns an image, with properties set, as the MyImage()... Not sure how to setup that, within a function, exactly.