For some reason, I can't get the xpos/ypos feature to be consistent. If I show an image like this...
show character at Position(xpos=50,ypos=50)
And I show the same image, as an imagebutton...
imagebutton:
idle "character.png"
xpos 50 ypos 50
They don't match up. The two images appear in different places! I don't understand why, since they're at the same coordinates. What's going on? Am I showing images incorrectly, or something?
I tried checking the documentation (https://www.renpy.org/doc/html/displayi ... -statement), but all it says about "show at" is "The at property takes one or more comma-separated simple expressions." I have no idea what that means. The only example they give for "show at" is "show image at right", which doesn't help, either.
Trouble with "Show image at xpos"
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
- Newbie
- Posts: 3
- Joined: Sat Dec 16, 2017 12:17 pm
- Contact:
Re: Trouble with "Show image at xpos"
Try to set padding property for a button - https://www.renpy.org/doc/html/style_pr ... ty-padding
-
- Regular
- Posts: 159
- Joined: Fri Jan 04, 2019 3:44 pm
- Contact:
Re: Trouble with "Show image at xpos"
I believe Position is considered deprecated these days, try using Transform instead which should match your imagebutton much better.
-
- Newbie
- Posts: 3
- Joined: Sat Dec 16, 2017 12:17 pm
- Contact:
Re: Trouble with "Show image at xpos"
Thanks! I can try looking into padding and transform. Any chance you can give an example of what the code might look like, if I use those features? Would it be something like Transform(image,xpos=50,ypos=50) or imagebutton.padding xpos 50 ypos 50?
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3791
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Trouble with "Show image at xpos"
You're using the image button inside a screen, right?
Are you able to share the screen code and we can see what maybe worth looking at regarding padding / margins.
Are you able to share the screen code and we can see what maybe worth looking at regarding padding / margins.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
-
- Newbie
- Posts: 3
- Joined: Sat Dec 16, 2017 12:17 pm
- Contact:
Re: Trouble with "Show image at xpos"
Sure, I can share the code. First is the character as an imagebutton on a screen. The player clicks on the character and is taken to a scene, where the character talks. I had to change the xpos and ypos values, so the character appears in the same spot, both times. If you use the same same xpos and ypos values for both, the character moves to the left.
screen puzzle_3_solve_7:
imagemap:
ground "images/scenes/3/background.png"
imagebutton:
idle "character.png"
xpos 1050 ypos 331
action [Jump("puzzle_3_solve_8")]
label puzzle_3_solve_8:
scene background
show character at Position(xpos=1076,ypos=460)
character "I am saying something."
screen puzzle_3_solve_7:
imagemap:
ground "images/scenes/3/background.png"
imagebutton:
idle "character.png"
xpos 1050 ypos 331
action [Jump("puzzle_3_solve_8")]
label puzzle_3_solve_8:
scene background
show character at Position(xpos=1076,ypos=460)
character "I am saying something."
Who is online
Users browsing this forum: No registered users