Author Topic: Atlas-update problem  (Read 17840 times)

Jerware

  • Guest
Re: Atlas-update problem
« Reply #15 on: June 15, 2012, 04:22:37 PM »
Thanks for the response, Nicki, but I think you misread the problem I have have. After assigning a border on all sides of 1px, the next time I Add/Update ANY SPRITE in the atlas the 3x3 sprite is cropped to 1x1. See my screenshots above.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: Atlas-update problem
« Reply #16 on: June 16, 2012, 07:12:35 AM »
It only does that when you set the actual size, no? Adding a border should stick - it does for me.

Edit: As I can see from your picture, you're setting the actual size (green), where you should just set the Border (blue) and use a sliced sprite for your white box.
« Last Edit: June 16, 2012, 07:27:48 AM by Nicki »

Jerware

  • Guest
Re: Atlas-update problem
« Reply #17 on: June 16, 2012, 11:23:34 AM »
Brilliant! I don't know why I didn't think of that. Thanks for the clarification.

Rafe

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Re: Atlas-update problem
« Reply #18 on: August 05, 2012, 03:54:35 PM »
Hi, I was having this issue as well. While this explains it, I am still not sure what I can do.

I created small black and white squares for a lot of GUI filler, such as simple progress bars. I chose 9px by 9px because I figured the edges would be blurred and I would be able to crop in on the atlas. It worked fine until I updated the atlas and my nice clean edges went blurry because the image was reduced to the crop dimensions.

1) Is this the expected atlas behaviour?
2) Do you have any tips on how to make this work?

Cheers,

- Rafe

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas-update problem
« Reply #19 on: August 05, 2012, 04:10:00 PM »
Crop dimensions? The atlas will not trim anything inside the green rectangle.

Rafe

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Re: Atlas-update problem
« Reply #20 on: August 05, 2012, 06:14:14 PM »
The image that I added is 9x9. It has a blury edge.
I wanted to crop in to make a clean edge.
I used the dimensions but when the atlas updated, the image was cropped so the blurry edges were back.

Is there a way to drop a pixel off the edge of an image?

I'm not talking about the 9-slice, which might still be needed on top of this. I'm talking about the blurry edge to the image once added to the atlas.

Let me know if some screen shots would help.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas-update problem
« Reply #21 on: August 05, 2012, 06:39:28 PM »
Use a sliced sprite to display it instead of a regular sprite, and you won't see any blurriness. Furthermore, everything outside the green rectangle is discarded. You need to specify an inner border instead, just like in that picture.

Rafe

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Re: Atlas-update problem
« Reply #22 on: August 05, 2012, 06:53:11 PM »
Use a sliced sprite to display it instead of a regular sprite, and you won't see any blurriness. Furthermore, everything outside the green rectangle is discarded. You need to specify an inner border instead, just like in that picture.

The boarder pixel is still blurry even with a sliced sprite (which I mentioned I am already using). Does this comment in your release notes address the issue?

Quote
- NEW: You can now specify a UV rect for the UITexture if you only wish to display a part of it.

Thanks for the quick replies!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas-update problem
« Reply #23 on: August 05, 2012, 07:06:44 PM »
As I mentioned, specify a border on the sprite. Select the atlas, choose your sprite, put '1' for all 4 border values.

Rafe

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Re: Atlas-update problem
« Reply #24 on: August 05, 2012, 07:46:03 PM »
As I mentioned, specify a border on the sprite. Select the atlas, choose your sprite, put '1' for all 4 border values.

I understand. I have tried that. Please see the attached image. It shows the boarder settings and the result. My question is, is there a way to crop in on the image so the blurry pixel, which is inside the boarder, is not displayed?

Cheers,

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas-update problem
« Reply #25 on: August 05, 2012, 07:53:23 PM »
You only see it blurry because that texture is zoomed in way past its original 9x9 size. That's how texture filtering works. When you zoom in, you get blurriness. When displayed at its 1x1 size, you will never see any blurriness.

Rafe

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Re: Atlas-update problem
« Reply #26 on: August 06, 2012, 02:05:49 PM »
My apologies. The sprite was NOT a sliced sprite. I was confusing it with another setup. It IS sharp with a sliced sprite. So...

I changed the background of the UISlider to a sliced sprite, but the foreground still has to be sliced to work. Is there such thing as a sliced+filled sprite? A simple progress bar is a great use for sliced sprites.

Thanks for sticking with me. Noob mistakes!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas-update problem
« Reply #27 on: August 06, 2012, 02:24:56 PM »
Sure. The slider can work with a filled sprite or a regular sprite all the same.

Rafe

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 78
    • View Profile
Re: Atlas-update problem
« Reply #28 on: August 06, 2012, 08:54:21 PM »
I tried replacing the foreground with a sliced sprite but when I change the UISlider value the sliced sprite just translates back and forth and disappears when the slider is zero. Any idea what I am doing wrong?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Atlas-update problem
« Reply #29 on: August 06, 2012, 09:14:16 PM »
When you create a slider in NGUI using the widget wizard it creates it using sliced sprites. Did you mean you replaced it with a regular sprite? Make sure that the full size is specified correctly on the UISlider.