Page 1 of 1

Current Location Label [SOLVED]

Posted: Sat Oct 30, 2021 3:16 pm
by yon
What I'd like to do is include a label which shows the general location and specific location of the main character during normal VN segments.

The top right of the UI mockup is what I'm going for. What sort of UI setup do I need to do to have that there? I'm fine with changing the value of it whenever the scene changes.

I don't plan for it to be interactive, or clickable. I just want it to be a label.

Re: Current Location Label

Posted: Sun Oct 31, 2021 11:23 am
by rayminator
first you do this

Code: Select all

default location = ["livingroom", "bathroom", "Kitchen"]

label start:
    $ location = "livingroom"
    show screen location
    "I am at the livingroom."

screen location():
    text "[location]"
or you can do it this way I was going post something like this
https://www.youtube.com/playlist?list=P ... z0g3mNDCuH

Re: Current Location Label

Posted: Mon Nov 01, 2021 3:57 am
by yon
I took what you had and it seems to work, though now I just have some transparent text hovering over part of the screen. That's okay, though. I think I can scrap something together to align it properly and set a background image.

I'm not sure which video you were referring to since your link goes to an entire playlist of videos. Thank you for the example code, though.

The only thing I'm still not sure of is how to integrate what seems to be an array for the location's default strings? I'm probably going to have to manually type in the new location label every time I need it to update, so it's fine if I just have the default set to something like blank text or "???", right?

Re: Current Location Label

Posted: Mon Nov 01, 2021 8:04 pm
by felsenstern
Not sure what he tried to achieve with the array and the following code. Because the moment when you write $ location = "livingroom" the list of ["livingroom, "bathroom", "Kitchen"] gets overwritten with a simple string.

And to position a single text line would look like:

Code: Select all

screen location():
    text "[location]":
        xpos 400
        ypos 50
or alternatively:

Code: Select all

screen location():
    text "[location]":
        pos (400, 50)

Re: Current Location Label

Posted: Tue Nov 02, 2021 3:45 am
by yon
Thank you.