Ui text?

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.
Message
Author
User avatar
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Ui text?

#1 Post by azureXtwilight »

Whenever I make an ending gallery, the ui.text font follows the default font. Is there any way to change that?
Image

User avatar
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Re: Ui text?

#2 Post by azureXtwilight »

Or there isn't any way?
Image

number473
Regular
Posts: 195
Joined: Tue Dec 15, 2009 4:20 am
Projects: The Duke's Daughter
Location: Cape Town
Contact:

Re: Ui text?

#3 Post by number473 »

Could try this reference: Properties
Mental weather report: Cloudy with a possibility of brain storms.

Cironian
Regular
Posts: 33
Joined: Sun Aug 26, 2007 5:34 pm
Projects: Dragon Story
Contact:

Re: Ui text?

#4 Post by Cironian »

Code: Select all

ui.text("Hello World", style=style.galleryText)

User avatar
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Re: Ui text?

#5 Post by azureXtwilight »

Cironian wrote:

Code: Select all

ui.text("Hello World", style=style.galleryText)
How do I define this, exactly?
Image

User avatar
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Re: Ui text?

#6 Post by azureXtwilight »

Sorry, but I have to bump it... again.
Image

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Ui text?

#7 Post by Aleema »

Code: Select all

style.galleryText.font = "myfont.tff" #For a style
ui.text("My Text", font="myfont.tff") #For that one line
number473 was right in that you need to look into learning about Properties. They're what customizes the code.

User avatar
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Re: Ui text?

#8 Post by azureXtwilight »

Thanks! You're so great, Aleema!
Sorry for asking again, guys... This time is about combining ui.text and ui.image map.
(I'm a noob who have too many dreams)

I know how to make imagemaps, such as main menu imagemaps and game menu imagemaps, also the simple imagemap.
But how do I combine ui.text and imagemaps?

To explain it more easily, I have this image:

Image

Something similar to that
The ui text will be at the title and explanation.
You know it'll save more space this way, as I will make LOTS of mission, and if I have to make different images for each mission sheet, meh. :|

Now then, which one should I edit from this simple imagemap code? Do I simply insert something like

Code: Select all

$ result = renpy.imagemap("ground.jpg", "hover.jpg", [
        (8, 200, 86, 278, "swimming"),
        (204, 50, 282, 128, "science"), 
        (452, 79, 530, 157, "art"),
        (602, 316, 680, 394, "go home"),
        ], focus="imagemap")
and edit it?

Or should I make an entirely different coding?
Image

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Ui text?

#9 Post by Aleema »

You don't want an imagemap for this. The imagemap will cover up everything, so you wouldn't see the explanation. You need to build that from UI functions. Work with hbox, vbox, and one of the buttons (imagebutton/textbutton), and yeah, ui.text.

User avatar
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Re: Ui text?

#10 Post by azureXtwilight »

Is that similar to building gallery functions? (like ending gallery or image gallery)
Image

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Ui text?

#11 Post by Aleema »

Ummm ... *goes to check* Oh, jeez. Looking from the CG gallery script in the cookbook, I'd have to say no.

There's a quick example on the top of the documentation for UI Functions: http://www.renpy.org/wiki/renpy/doc/ref ... _Functions

User avatar
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Re: Ui text?

#12 Post by azureXtwilight »

Ah, I see.
It's similar to the ending gallery then, something like this, right?

Code: Select all

$ ui.textbutton("Return", clicked=ui.jumps("main_menu_again"), xalign=1.0)
    $ ui.vbox(xalign=0.5,ypos=0.2)
    if persistent.ending4:
        $ ui.textbutton("1. Worst Ending 1 : Killed by the Hands of a Murderer")
    elif not persistent.ending4:
        $ ui.textbutton("1. ???")
Image

User avatar
Aleema
Lemma-Class Veteran
Posts: 2677
Joined: Fri May 23, 2008 2:11 pm
Organization: happyB
Tumblr: happybackwards
Contact:

Re: Ui text?

#13 Post by Aleema »

Yeah, though you wouldn't need persistent data. Just regular variables will do.

User avatar
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Re: Ui text?

#14 Post by azureXtwilight »

Yes, it was a sample ending gallery.

Will learn to code it! Thank you!
Image

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Ui text?

#15 Post by Jake »

Aleema wrote:The imagemap will cover up everything
(For what it's worth, while I agree that an imagemap isn't the best course of action here, you can make imagemaps out of mostly-transparent PNGs and they won't cover anything other than the parts of the screen where they have opaque pixels.)
Server error: user 'Jake' not found

Post Reply

Who is online

Users browsing this forum: Google [Bot]