Jump to content

Basic Scaling, Animation, and Parallax Tutorial


Joe Kopena
 Share

Recommended Posts

In (re)acquainting myself with Pixi for some hobby projects, I put together a simple example and walkthrough of scaling to fit device dimensions, using hi-res resources, animating a sprite, doing some basic parallax scrolling with tiling sprites, and assembling spritesheets with TexturePacker:

http://www.rocketshipgames.com/blogs/tjkopena/2015/09/basic-scaling-animation-and-parallax-in-pixi-js-v3/

 

I hope it's of use to somebody, and would love to hear any comments about any errors or sub-optimal code.

Thanks!

 

Link to comment
Share on other sites

  • 1 month later...
This is great, I haven't seen all of this info tied together before, mostly I've found bits and pieces all over the web.

 

I have a question about the use of 2x files. I've seen these used in IOS demos, but in Andoid demos, the usual advice is to use the pixel ration as a scaling multiplier for a single set of images. Why should I use 2 sets of files? What is the benefit over soft scaling?

Link to comment
Share on other sites

Thanks, I'm glad you got something out of it!

I believe it's the same as for the Retina displays.  The DPI on high end Androids is similar or even above Apple devices at this point, so you'd want to use hi-res images for the same visual quality reasons.  Even my now aging S3 has a ridiculously good display compared to my laptop, and requires double scaling the assets to get a useful image size.  My assumption is that this issue is mostly only talked about in terms of Retina because:

  • It's more recent that there are such non-Apple devices;
  • The capability is not as conveniently branded under a single trademark buzzword ("Retina");
  • There's a lot more variance across Android devices so it's similarly not really meaningful to discuss as an Android thing and there are literally billions of Android devices to which it doesn't apply.

But if the DPI on a device is high enough, I don't see why you wouldn't apply the same techniques.

 

That said, I don't do this professionally or anything, so there could certainly be something I'm missing.

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