Author Topic: Localization for buttons  (Read 4597 times)

luisdiv

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Localization for buttons
« on: July 10, 2012, 11:29:54 AM »
Hello there!

I'm wondering if there's anyway so that the Localization scripts change the Hover and Pressed button sprites...? I can't seem to be able to add the UILocalize script to buttons ("The script class can't be abstract!"), but only the background sprite, which only works until the user hovers or presses.

Please help!

Luis

PhilipC

  • Guest
Re: Localization for buttons
« Reply #1 on: July 10, 2012, 02:12:32 PM »
Correct you cant add the UIlocalise script to a "button" it needs to be attached to a widget (UILabel, UISprite, UITexture) due to the line at the top "[RequireComponent(typeof(UIWidget))]". I also cant remember/ find a script that will change the buttons sprite depending on the state.

So that being said youd have to write your own script which would listen for the OnHover, OnPress, and OnLocalize. using those methods you should be able to change the sprite based on both language and state.

 

luisdiv

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 32
    • View Profile
Re: Localization for buttons
« Reply #2 on: July 10, 2012, 02:33:52 PM »
Thank you Philip!
I'll try and see what I can do