Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
-
Dookiesh0ez
- Newbie
- Posts: 8
- Joined: Wed May 24, 2017 3:53 pm
- Projects: Sexventure Time
-
Contact:
#1
Post
by Dookiesh0ez » Wed May 24, 2017 3:59 pm
I'm trying to use show screen to show text at a certain coordinate. I saw documentation that it should look something like this
Code: Select all
screen money:
text ("%d" % money)
xpos 10.0
ypos 10.0
But that isn't working, the text always displays at the upper left corner, 0, 0. And frustratingly I now can't find the page in the documentation or wiki where I originally found this and I need to get this done to move on.
So what is the correct way to set the coordinates of this text?
-
xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
-
Contact:
#2
Post
by xavimat » Wed May 24, 2017 4:09 pm
Two problems and a two suggestions:
1. There is an indentation problem in your code. Here there are two options.
2. An integer number means "pixels" a float number means "% in the screen". This is somewhat tricky, see the tutorial game to learn about it.
3. Don't need the % python code, the simple [variable] should do.
4. Don't forget the parenthesis in the screen definition (it's improved SL).
Code: Select all
screen money():
text "[money]" xpos 10 ypos 10
text "[money]":
xpos 10
ypos 10
-
Dookiesh0ez
- Newbie
- Posts: 8
- Joined: Wed May 24, 2017 3:53 pm
- Projects: Sexventure Time
-
Contact:
#3
Post
by Dookiesh0ez » Wed May 24, 2017 4:14 pm
xavimat wrote:Two problems and a two suggestions:
1. There is an indentation problem in your code. Here there are two options.
2. An integer number means "pixels" a float number means "% in the screen". This is somewhat tricky, see the tutorial game to learn about it.
3. Don't need the % python code, the simple [variable] should do.
4. Don't forget the parenthesis in the screen definition (it's improved SL).
Code: Select all
screen money():
text "[money]" xpos 10 ypos 10
text "[money]":
xpos 10
ypos 10
Thanks for the quick reply. Good to know the float / int difference. And I never would have known the indentation was wrong because I wasn't getting any exceptions, strange.
-
xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
-
Contact:
#4
Post
by xavimat » Wed May 24, 2017 4:24 pm
Dookiesh0ez wrote:And I never would have known the indentation was wrong because I wasn't getting any exceptions, strange.
I'll report it as a possible bug: Should xpos and ypos outside a screen element cause an exception?
-
Dookiesh0ez
- Newbie
- Posts: 8
- Joined: Wed May 24, 2017 3:53 pm
- Projects: Sexventure Time
-
Contact:
#5
Post
by Dookiesh0ez » Wed May 24, 2017 5:57 pm
I don't know, I'm not that familiar with renpy, but every other indentation error i've had so far has caused one. I don't really see how xpos and ypos outside of the correct syntax could be useful though.
-
xavimat
- Eileen-Class Veteran
- Posts: 1458
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love, unknown
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
-
Contact:
#6
Post
by xavimat » Sat May 27, 2017 11:14 am
renpytom has solved it. It was a bug. In the next release it should throw an exception (IIUIC).
Thanks.
https://github.com/renpy/renpy/issues/1188
Users browsing this forum: Google [Bot]