Author Topic: NGUI 9 patch textures  (Read 5471 times)

elvess

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
NGUI 9 patch textures
« on: July 01, 2013, 07:59:50 AM »
Hello.
I have a question. Is there a way to use 9 patch textures in NGUI?
I mean not to use Border settings in SlicedSprite Atlas but just create 9 patch textures in draw9patch and use them.

Thank You.
Best regards,
Paul

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI 9 patch textures
« Reply #1 on: July 01, 2013, 06:37:15 PM »
Outside of the sprite system, I don't think you're going to get that out of the box. You can however make a modified UITexture, say UISlicedTexture, that uses the same principle that 9-sliced UISprites do and define borders on the texture directly.

elvess

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: NGUI 9 patch textures
« Reply #2 on: July 02, 2013, 02:35:13 AM »
Thank U.
I tried to use UISLiceSprite and i got space that should be tiled - scaled.
The way U purpose will give the same result?
Or its possible to tile, not to scale?
I selected space to tile by border settings and this space scaled.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: NGUI 9 patch textures
« Reply #3 on: July 02, 2013, 05:48:30 AM »
Yeah, so with UISlicedSprite, only the corners are preserved while the other 5 patches are stretched. If you want them to tile, you will have to implement your own version of SlicedSprite.

elvess

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: NGUI 9 patch textures
« Reply #4 on: July 02, 2013, 05:57:39 AM »
Understood. Thank U very much.