Page 1 of 1

Getting image from sprite atlas

PostPosted: Tue Oct 31, 2017 8:48 am
by tingdo
Hi,

was just wondering, I have this sprite atlas. But how do I have the shader retrieve a portion of the atlas and display it?

Thanks!

Re: Getting image from sprite atlas

PostPosted: Tue Oct 31, 2017 10:37 am
by Amplify_Borba
Hello tingdo,

Thank you for getting in touch and for your support!

We do provide a couple of examples in the ASE package, more specifically in the Examples > Official > ReadFromAtlasTiled folder, that can point you in the right direction.

Please let me know if these examples are useful or if you have any further questions, thanks!

Re: Getting image from sprite atlas

PostPosted: Wed Nov 01, 2017 6:18 am
by tingdo
AH! I see thats really great, the examples are a great help. Should have spent more time poking around in the folders!

Just one more thing. How would I add a panner to this?

Re: Getting image from sprite atlas

PostPosted: Wed Nov 01, 2017 11:57 am
by Amplify_Borba
tingdo wrote:AH! I see thats really great, the examples are a great help. Should have spent more time poking around in the folders!

Just one more thing. How would I add a panner to this?


We do provide a Panner node with a Time property that allows panning over time or manually, would you kindly elaborate on the intended use for it?

Re: Getting image from sprite atlas

PostPosted: Thu Nov 02, 2017 2:04 am
by tingdo
Oh sorry, yea I am trying to apply the panner node to the texture that was cut out from the atlas, but cant figure out where to plug the panner node in?

Trying to make a panning signboard with just that texture from the atlas.

Re: Getting image from sprite atlas

PostPosted: Thu Nov 02, 2017 10:16 am
by Amplify_Borba
tingdo wrote:Oh sorry, yea I am trying to apply the panner node to the texture that was cut out from the atlas, but cant figure out where to plug the panner node in?

Trying to make a panning signboard with just that texture from the atlas.


The ReadFromAtlasTiled sample wasn't build to account for that specific use, so it would require some extensive modifications, however I can point out a simple way of doing it that might be useful for you to get started on your own shader, or even modify the aforementioned one!

pan.jpg
pan.jpg (127.39 KiB) Viewed 1855 times


The key node here is Fract, you may read more about it on the wiki.

Please let me know if this information was useful and if you have any further questions, thanks!