Author Topic: Problem with position image in UITexture  (Read 5850 times)

Evgeny

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Problem with position image in UITexture
« on: January 18, 2016, 01:55:00 PM »
We use the latest 4x Unity with latest 3x NGUI.
I have texture with resolution 665*75 pixels png. I  made UITexture with widget size 665*75.
And what I see in the corners :)

Now as you can see NGUI randomly changes sizes of the buttons (for some of the identical buttons it scales 1 pixel down from vertically or/and horizontally).

That leads to the buttons are not positioned properly and some strange pixel blurr/opacity effect over the buttons appears. How to fix that?

Please, help us to fix that.

Why image with IDENTICAL size look's like this? Any ideas?

MrNixon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 4
    • View Profile
Re: Problem with position image in UITexture
« Reply #1 on: January 18, 2016, 06:50:55 PM »
As the customer who bought NGUI I'd like to request help about that issue as well ...



Why is there some strange 1 pixel blurr displacement (partially transparent) appears around the images?

MrNixon

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 4
    • View Profile
Re: Problem with position image in UITexture
« Reply #2 on: January 19, 2016, 11:06:34 AM »
More screens with empty spaces in frames:




ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem with position image in UITexture
« Reply #3 on: January 20, 2016, 08:27:29 AM »
Look at your sprite. Your sprite's dimensions are not dividable by two, and yet you want it to be centered on both X and Y. How can this be done? Math: 665/2 = 332.5. Can't do this without the whole picture being blurry, so NGUI has to add a virtual pixel to make it dividable by 2.

Either change the pivot point to be in a corner, such as top-left, or make your sprite's dimensions dividable by two.

Evgeny

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Problem with position image in UITexture
« Reply #4 on: January 20, 2016, 11:22:53 AM »
Working! :) Thnx :)

But only if  point to be in a corner, such as top-left, AND make your sprite's dimensions dividable by two.
« Last Edit: January 20, 2016, 12:26:22 PM by Evgeny »

Evgeny

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: Problem with position image in UITexture
« Reply #5 on: February 02, 2016, 01:22:23 PM »
Following problem :(

On all UITexture there were blurred borders. Exactly from top and bottom on one blur pixel.

The UITexture size strictly corresponds to a picture resolution. Height and width the even. The Aligment is established in the left top corner.



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Problem with position image in UITexture
« Reply #6 on: February 04, 2016, 08:55:49 PM »
Turn off compression on your texture if you want it to be crisp even when you zoom in on it. Since you're using a raw texture, I'd also suggest ensuring that it's set to Clamp instead of Repeat.