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.
text _("((No new messages))"):
if lang == "spanish":
xpos 150
else:
xpos 200
ypos 10
size 90
color "#7693BF"
because in spanish the phase is not centered, while in english, it is. Thing is, when I execute that, ren'py says lang is not defined, and persistent.lang seems to be defined but does not affect the condition, it always goes to the else clause. What am I doing wrong?
1564 Studio, an indie studio dedicated to developing mystery VNs!
Follow us on Twitter for updates on our projects!
Check out our current project, just released on PC, Android, Switch, XBox ONE/Series S/X and PS4/5!
Also available in Spanish, English, French and Japanese!
Are you *100%* sure that you have enough room for the (long spanish) text in whatever "box" you are placing it in?
Sounds like it might not have enough room - and thus "overflows" the box it's in (and thus looks as if it's not centered, because it's taking up all the box + a bit)
1564 Studio, an indie studio dedicated to developing mystery VNs!
Follow us on Twitter for updates on our projects!
Check out our current project, just released on PC, Android, Switch, XBox ONE/Series S/X and PS4/5!
Also available in Spanish, English, French and Japanese!
And by trying to adjust the value, it seems that both end up misaligned with one another, same problem that I had with xpos. I'll paste the whole code of the screen to see if it sheds some light into the issue:
screen chat_log(log):
viewport id "chatlog":
mousewheel True
draggable True
if not(log.history()):
text _("((No new messages))"):
xalign 0.5
ypos 10
size 90
color "#7693BF"
vbox:
spacing 10
for type, kwargs in log.history():
use expression type pass (**kwargs)
if(log.history()):
vbar value YScrollValue("chatlog"):
xpos 1000
1564 Studio, an indie studio dedicated to developing mystery VNs!
Follow us on Twitter for updates on our projects!
Check out our current project, just released on PC, Android, Switch, XBox ONE/Series S/X and PS4/5!
Also available in Spanish, English, French and Japanese!
Are those screenshots of the whole screen? or partials?
It looks to me like the texts are both centered around the same point - which isn't far from the right edge of the center blue area in your widget.
Ie. the middle of each text lines up with each other.
How on earth that has become your center point I don't know.
If those screenshots are partials - I would guess the viewport takes up the whole screen?
In which case xalign 0.5 would be the middle of the screen.
And if your widget isn't centered on the screen then of course the text won't be either.
(the above might be obvious to you - Not sure about your skill level...)
There is also some wonkyness with your indentation of vbox and your last "if" - Might work as intended, I'm just unsure what that would be - It just caught my eye is all.
Do you really want to show that vbox even if there is no log.history?
and that last "if" looks as if it should be indented one more time (to align with the other if) - and why isn't it just an "else"?
The code is mostly taken from here: https://poorlifechoices.itch.io/renpy-chatlog and I tinkered with it a bit to adjust to what we want, so maybe I'm missing something there that moved the center point? I tried to xanchor to the center (game's resolution es 1920x1080 so 960), but that doesn't work either. The screenshots are the full screen of the game, but not the full screen of the pc (it's windowed, i just took the part of the game).
1564 Studio, an indie studio dedicated to developing mystery VNs!
Follow us on Twitter for updates on our projects!
Check out our current project, just released on PC, Android, Switch, XBox ONE/Series S/X and PS4/5!
Also available in Spanish, English, French and Japanese!
Ok, so apparently I was putting an xpos and ypos when calling the screen, now the message is shown as expected both in spanish and english, but now the chat looks like this and don't know where to put the xpos and ypos to move it:
1564 Studio, an indie studio dedicated to developing mystery VNs!
Follow us on Twitter for updates on our projects!
Check out our current project, just released on PC, Android, Switch, XBox ONE/Series S/X and PS4/5!
Also available in Spanish, English, French and Japanese!