Jump to content

Blurry Image after setting anchor to .5


Amitm
 Share

Recommended Posts

Hi All,

I have encountered a strange problem. I am creating two sprites from the same image. For one anchor is default 0 and for another it is set to 0.5,0.5. The sprite with anchor set to 0.5 looks blurry. For both the sprites x and y set to whole number. Now for the blurry sprite if I add .5 to both x and y position it looks sharp again. But my other images goes a bit blurry if I add 0.5 to x or y position. What might be the issue?

Thanks in advance.

screenshot1.jpg

Link to comment
Share on other sites

Is the texture width or height an odd number? That would explain the situation.

If that's the case then I know few ways to fix it.

- Use pivot point with x:Math.round( width/2), y:Math.round(height/2) instead of anchor.
- Calculate anchor point so that no half pixels are needed: x: Math.round(width/2)/width, y: Math.round(height/2)/height.

Link to comment
Share on other sites

For the second image here are the values :

Position :: x = 580 :: y = 258 :: bounds == {"x":386.5,"y":-0.5,"width":387,"height":517,"type":1}

though x and y are in whole number the bound x and y are in decimal. How to fix this, any idea?

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...