Author Topic: Edit and save text tooltip in game  (Read 4666 times)

logiquefloue

  • Guest
Edit and save text tooltip in game
« 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.

LightSky

  • Jr. Member
  • **
  • Thank You
  • -Given: 3
  • -Receive: 2
  • Posts: 56
    • View Profile
Re: Edit and save text tooltip in game
« Reply #1 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.

logiquefloue

  • Guest
Re: Edit and save text tooltip in game
« Reply #2 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

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Edit and save text tooltip in game
« Reply #3 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.

logiquefloue

  • Guest
Re: Edit and save text tooltip in game
« Reply #4 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!)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Edit and save text tooltip in game
« Reply #5 on: September 05, 2013, 05:20:00 AM »
Tooltip in the inventory example auto-scales the background sprite to envelop its content.

logiquefloue

  • Guest
Re: Edit and save text tooltip in game
« Reply #6 on: September 05, 2013, 05:40:57 AM »
Thank you for your answers  :)