UI.imagebutton text problem

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
J13
Regular
Posts: 60
Joined: Wed Jan 24, 2007 3:28 am
Location: Cambridge
Contact:

UI.imagebutton text problem

#1 Post by J13 »

I'm just a little stuck and was hoping someone might be able to point me in the right direction.
I'm trying to create a UI which has custom buttons which are highlighted when you mouse over them, i used the following to do this

Code: Select all

label convoa:
    $ ui.at(tl)    
    $ ui.imagebutton('chat/tl.png', 'chat/tla.png', clicked= ui.jumps('answera'), image_style='image_button_image')
    $ ui.at(tr)    
    $ ui.imagebutton('chat/tr.png', 'chat/tra.png', clicked= ui.jumps('answerb'), image_style='image_button_image')
    show text 'talk about this' at tl
    show text 'talk about that' at tr
    $ renpy.pause(180.00)
    jump convo
the problem is the text i want on the buttons appears behind them instead of on top.
While i would normally just put the desired text on the png itself i want to be able to re-use the UI with different text later.
Any help would be appreciated.

monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

Re: UI.imagebutton text problem

#2 Post by monele »

Mmmmmm.... I *think* there's a way.
It would involve using the ui.button (I'm pretty sure there's an object which is a container and makes anything inside it count as part of the whole button)... and then put the image + text inside. You may also need to place the image and text in an absolute way (no hbox or grid).

J13
Regular
Posts: 60
Joined: Wed Jan 24, 2007 3:28 am
Location: Cambridge
Contact:

Re: UI.imagebutton text problem

#3 Post by J13 »

Well i spent the last couple of days trying to work this out using the ui.button reference page with no luck at all, guess i'll have to just make an image file for each button.
Thanks for the help anyway though.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Black Spriggan, Ocelot, snotwurm