Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: logiquefloue on September 04, 2013, 01:03:42 PM

Title: Edit and save text tooltip in game
Post by: logiquefloue on September 04, 2013, 01:03:42 PM
I'm about to buy Ngui ... But before that, I want to make sure this feature is possible:
You can edit and save the text of a UILabel.
Tooltip system exists.
in my game, I want the player to can change and save the text in a tooltip (as in the comments of Excel cells)
Ngui offers this?

Thank you.
Title: Re: Edit and save text tooltip in game
Post by: LightSky on September 05, 2013, 01:18:21 AM
Tooltip system exists.

NGUI has built-in Tooltip support.

You can edit and save the text of a UILabel.

This is not built-in, however it can be easily added in a few lines of code by saving the text to PlayerPrefs whenever it is changed and reloading it when needed.

NGUI offers what you need to start with, but you may need to write a bit of code to get it working in the exact manner that you want.
Title: Re: Edit and save text tooltip in game
Post by: logiquefloue on September 05, 2013, 02:36:36 AM
Thank you for the reply  :)

The function to write and save in Label already exists in Ngui (script UIInput saved).

My question is it's : I can change the text in the tooltip and save?

thank you
Title: Re: Edit and save text tooltip in game
Post by: ArenMook on September 05, 2013, 04:38:44 AM
Change the text in the tooltip? That makes no sense to me. You get OnTooltip notification, and it's up to you to display the tooltip using whatever text you need.
Title: Re: Edit and save text tooltip in game
Post by: logiquefloue on September 05, 2013, 05:00:54 AM
Ok I understand,

I did not explain my goal!
I want to display a text box with a window (a SlicedSprite) that fits the size of the text in real time.
Label works fine except that there is not the (SlicedSprite) on which the text is displayed.

I hope I have understood you (sorry for my english!)
Title: Re: Edit and save text tooltip in game
Post by: ArenMook on September 05, 2013, 05:20:00 AM
Tooltip in the inventory example auto-scales the background sprite to envelop its content.
Title: Re: Edit and save text tooltip in game
Post by: logiquefloue on September 05, 2013, 05:40:57 AM
Thank you for your answers  :)