startupper

Spritesheet, Change Image

Recommended Posts

I'm a little irritated at the moment.
A sprite sheet is to be loaded and displayed. The sprite sheet consists of several individual images (2, 3, ... 5, ... 10, ... any). I would like to change these pictures.
Unfortunately, I find no suitable example. On the basis of an animation, with Play and Change Texture, it can not be, it is always only a single picture to the next switch.
Does anyone have a suggestion? Thank you.

PS: Of course, I also have a JASON file to it.

Share this post


Link to post
Share on other sites

Are you looking to use frames from multiple spritesheets for a single animation? I don't think you can mix frames fromendifferent sources that way. 

Or are you looking to switch to a new texture on a sprite for new animations? This can be done. After loading a new texture on the sprite, you will need to redefine the animations, then play the animation. 

Im away from my computer ATM, so I can't show you and example. I'll try to the next time I'm able of you haven't gotten it to work till then. 

Share this post


Link to post
Share on other sites

Hey Flashy,
It is one Spritesheet. One JSON-File.
Maybe i mean "change texture"!?

I just want to exchange pictures.
If ..., then go from picture 1 to picture 2.
If ..., what else, then go from picture 2 to picture 3.

Later i build it then with buttons, or something else, depending on how I need it.
As I said, animation play I think for overflow, because there are only standing images, no anis.

spriteshee_example.jpg

Share this post


Link to post
Share on other sites

just create more than one animation and put animations.play into the if, example on your example:

a = animation from 1 to 2;

b = animation from 2 to 3;

if.... a.play

else....b.play

i'm noob here but i think this can be work

 

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.