Author Topic: Sliced Sprite around Text with resize  (Read 2345 times)

iossif

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Sliced Sprite around Text with resize
« on: September 18, 2012, 07:23:45 AM »
i am wondering (and not finding a way currently) if it is possible, to put a sliced sprite around a panel or any kind of text field.

what i want to do: i have tons of texts in my current project and i want to put the text into text baloons on runtime. therefor i require a dynamic way of creating text input (with multiple lines) and also a way to put a border around it.

the sliced sprite looks great in theory but i cannot find a way to get it to work.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Sliced Sprite around Text with resize
« Reply #1 on: September 18, 2012, 08:52:08 AM »
Look into how UITooltip works. It resizes a sliced sprite to envelop the dynamic label.

iossif

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: Sliced Sprite around Text with resize
« Reply #2 on: September 18, 2012, 09:59:49 AM »
thanks. will do that!

at the moment i have a running version with CalculatePrintedSize and resizing after some math which works but is not pretty. maybe your solution is more straight forward.