Jump to content

ipad retina texture resizing


PrettyMuchBryce
 Share

Recommended Posts

I'm using pixi 2.2.5, and recently tried my project out on a retina ipad. I'm running into a strange texture resizing issue. This is probably my fault somehow, but I am struggling to figure out how to get the ipad to resize the texture properly.

 

As you see in the attached image, it seems mobile safari is off by 1 pixel when trying to render each tile sprite. This makes it look like theres some space between each tile because it is actually partially rendering the bottom of the tile above this one in the texture. The tile sprites themselves live in a SpriteBatch, and I'm doing some resizing by setting the scale on this SpriteBatch itself. 

 

I'm not doing anything else special to try to support this device other than a viewport meta tag. I figure this may be related to the device pixel ratio. I tried to double the size of the tile spritesheet, but the issue still seems to occur.

post-6188-0-73084200-1424653946_thumb.pn

Link to comment
Share on other sites

I had an issue that may be related. Actually two issues. Some of the sprite animations (MovieClips) were "shaking" on iOS, as if some of the frames were off by one pixel. By sheer luck I noticed in the Pixi code that renderSession.roundPixels was always false, so I added an option to both renderers to set it to true. This helped for some iOS devices, but not all.  :huh: Next thing I did was to change my atlas images size to be a power of 2, which helped with the rest of the devices.

 

You can try these, maybe it will help, as both seem related to scaling/pixel rounding. :)

Link to comment
Share on other sites

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...