Author Topic: UI2DSprite  (Read 56326 times)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI2DSprite
« Reply #15 on: June 04, 2014, 02:09:13 AM »
The only way to make it smooth is to either use Anti-aliasing, or to give its texture a transparent border.

Fliperamma

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 13
    • View Profile
    • Fliperamma | Game On!
Re: UI2DSprite
« Reply #16 on: June 04, 2014, 08:24:24 AM »
The only way to make it smooth is to either use Anti-aliasing, or to give its texture a transparent border.
Thank you, that did the trick! I used a 2px margin in my PNGs and they look a lot better now.  ;)

DEngland

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: UI2DSprite
« Reply #17 on: August 13, 2014, 07:02:55 PM »
Hi ArenMook

Quote
When using Unity 4.5 or higher, the sprite will get 9-sliced according to the import settings.

I am very interested in figuring out how to set the 9-slice parameters in the import settings for UI2DSprites.
I'm using Unity 4.5.2f1 and NGUI v3.6.8 but after digging around in the import settings I haven't found those options. Am I looking in the wrong place, or has this functionality been pushed back?

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI2DSprite
« Reply #18 on: August 14, 2014, 08:14:24 AM »
Unity pushed that feature back until 4.6 (uGUI release).

I got tired of waiting for it, which is why I added a way to specify it on the UI2DSprite itself.

DEngland

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 9
    • View Profile
Re: UI2DSprite
« Reply #19 on: August 14, 2014, 03:01:04 PM »
Unity pushed that feature back until 4.6 (uGUI release).

I got tired of waiting for it, which is why I added a way to specify it on the UI2DSprite itself.

Thanks for the info ArenMook; I'll be looking forward to 4.6 then. In the meantime it's going to be a mess to programmatically set various images (with different slicing) into the same UI2DSprite.

lijiangood@yeah.net

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: UI2DSprite
« Reply #20 on: August 27, 2014, 09:10:20 PM »
I can drag NGUI Sprite to the "Sprite"  groove!And I want to know which style Sprite can use on it!

Zoidster

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UI2DSprite
« Reply #21 on: November 27, 2014, 07:40:01 AM »
Hi,
I'm using a 80x80 sprite and I'm upscaling it to 300x300. The image now looks blurry. Is there a way to have the UI2DSprite do upscaling with a different algorithm?
I'd liketo use a nearest neighbor interpolation method.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI2DSprite
« Reply #22 on: November 27, 2014, 09:05:52 PM »
When you enlarge a smaller texture, it will look blurry. That's how graphics work. You can change the texture to use Point Filtering, but that will just make everything look pixelated. That's your only option.

Zoidster

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UI2DSprite
« Reply #23 on: November 28, 2014, 02:40:33 AM »
That I knew, obviously. But can I apply point filtering to a graphic I have at runtime?
Or to a sprite I get from a pre-packed sprite-atlas?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI2DSprite
« Reply #24 on: November 30, 2014, 05:54:24 AM »
You can change a texture's filtering method, can you not?

Zoidster

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UI2DSprite
« Reply #25 on: December 01, 2014, 04:22:50 AM »
Is that possible at runtime?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI2DSprite
« Reply #26 on: December 02, 2014, 12:33:09 PM »
Texture2D.filterMode

Zoidster

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: UI2DSprite
« Reply #27 on: December 03, 2014, 06:02:36 AM »
Thank you for answering. I know you aren't my personal unity api but I thought it was a ngui problem.
Sorry

Benzino07

  • Newbie
  • *
  • Thank You
  • -Given: 3
  • -Receive: 1
  • Posts: 24
    • View Profile
Re: UI2DSprite
« Reply #28 on: February 16, 2015, 11:52:45 AM »
Hi,

Just wondering is there a reason why you cannot set Fixed Aspect for this sprite via code? Is there any way to get this functionality without modifying NGUI code?

Thanks

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI2DSprite
« Reply #29 on: February 17, 2015, 10:35:47 PM »
Hmm? All widgets have an aspect ratio field you can set. Sprites are widgets.