Author Topic: Custom UITexture  (Read 2020 times)

zyap

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Custom UITexture
« on: April 22, 2015, 04:21:29 PM »
Hi guys,
I'm new to the forum and currently using NGUI for work.
I have some questions in regards to UITexture.

There are types such as : Simple, Sliced, Tiled, Filled, and Advanced.
But none of these options seems to fit how I want to display images.

For example, I have attached 2 images.
Currently if you want to keep the aspect ratio of the image, you have to set Fixed Aspect to true. Now while that keeps the aspect ratio of the image, any resizing of the object, it will have empty spaces (left and right  as seen in the bottom section of the image that I attached).
The top section of the image is what I want to achieve. I managed to do this by creating my own UITextureCustom and changing some code.

I guess my first question is:
1) Is this achievable using the default UITexture? Maybe I overlooked some options.
My second question is this:
2) If this is not achievable using the default UITexture, how can I make it so that the path of the image that is outside the object are not rendered (drawed).
This is achievable if I put this object into a UIPanel and set its anchor to fit the UIPanels. But that seems like a hacky solution for me.

Thank you.


zyap

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Custom UITexture
« Reply #1 on: April 23, 2015, 01:02:40 PM »
Sorry, just realized I should've post this in ngui 3 support instead of here.