Switching namebox positions (solved)

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.
Post Reply
Message
Author
User avatar
Smaymay
Regular
Posts: 70
Joined: Fri Jul 01, 2016 11:35 am
Completed: Vicboys demo
Tumblr: esmmeh
Deviantart: Smaymay
Location: The Netherlands
Contact:

Switching namebox positions (solved)

#1 Post by Smaymay » Sat Mar 11, 2017 5:25 pm

I wonder if it would be possible to switch between two different nameboxes with two different positions relative to the textbox. My character sprites will only show up at two fixed positions. Left and right. I thought it would be nice to switch the position of the nameboxes to left or right depending who's talking. I'm still getting used to the new GUI interface so I don't know where to start. hehe...

Right now my character name tags are defined like this:

Code: Select all

define wr = Character("Waldo")
define n = Character(None)
I haven't changed anything yet to the default options.rpy, screens.rpy and gui.rpy files.

~ Thanks! :)
Last edited by Smaymay on Fri Mar 17, 2017 2:14 pm, edited 1 time in total.

User avatar
indoneko
Miko-Class Veteran
Posts: 528
Joined: Sat Sep 03, 2016 4:00 am
Contact:

Re: Switching namebox positions

#2 Post by indoneko » Sat Mar 11, 2017 5:47 pm

You can change the name position by using who_xpos=n where n is the new x-axis position

Code: Select all

define wl = Character("Waldo", who_xpos=10)
define mm = Character("Maymay", who_xpos=600)
define n = Character(None)
My avatar is courtesy of Mellanthe

User avatar
Smaymay
Regular
Posts: 70
Joined: Fri Jul 01, 2016 11:35 am
Completed: Vicboys demo
Tumblr: esmmeh
Deviantart: Smaymay
Location: The Netherlands
Contact:

Re: Switching namebox positions

#3 Post by Smaymay » Sat Mar 11, 2017 6:19 pm

@indoneko Thank you for your fast reply!

I tried it out. It switched the names!
Image

But not the nameboxes. :(

Image

I also looked at this tutorial and tried
window_xpos
instead of
who_xpos
and it DID change the position of my namebox! But also the position of my dialoguebox XD So it's probably a child I guess. Not the effect I was looking for either.

User avatar
Smaymay
Regular
Posts: 70
Joined: Fri Jul 01, 2016 11:35 am
Completed: Vicboys demo
Tumblr: esmmeh
Deviantart: Smaymay
Location: The Netherlands
Contact:

Re: Switching namebox positions

#4 Post by Smaymay » Fri Mar 17, 2017 2:14 pm

I ended up making two different dialogue box images.
  • - Dialogue box with name box at left
  • - Dialogue box with name box at right
And defined the names for my characters separately.

Code: Select all

define wrl = Character('Waldo', who_xpos=546, window_background="gui/textbox_left.png")
define wrr = Character('Waldo', who_xpos=1755, window_background="gui/textbox_right.png")
It's probably bad practice to code it like this. But hey it works. :)

Post Reply

Who is online

Users browsing this forum: enaielei