Page 1 of 2

Sprite sheets give me a headache

Posted: Sun Oct 10, 2021 4:01 pm
by richmond62
They do, you know, because I am sick and tired of spending yonks chopping them up into individual
images to use as backGroundPatterns for a graphic . . .

I am looking for guidance (NO, not THAT kind of guidance) on how I might use a sprite sheet in its raw, unprocessed form
to animate inwith a grc 'frame.
-
SShot 2021-10-10 at 17.57.16.png
-
NOT "cutting the mustard."

Re: Sprite sheets give me a headache

Posted: Sun Oct 10, 2021 6:08 pm
by richmond62
SShot 2021-10-10 at 20.01.18.png
-
Well; here's a crappy solution that uses a grouped image, but presupposes that one knows
where the centre of each image inwith the
sprite image lies (which I don't: hence the crappy result).

At which point, I suppose, I could piss about, chopping up the sprite image
to reposition the sprites to predetermined locations
(one could do that with importing a folder of the chopped up images, grouping them
and then importing a snapshot from the group), which is almost as fun as
banging one's head on the wall, chopping up the sprite image into bits for
backGroundPatterns, or standing on one leg for 25 years.

Re: Sprite sheets give me a headache

Posted: Sun Oct 10, 2021 6:13 pm
by richmond62
https://codeshack.io/images-sprite-sheet-generator/
You can use your favorite coding language to select the coordinates of each image and display them accordingly
Err, well, जै . . . I wonder how I can do THIS in my favOUrite coding language (erm: LiveCode)?

AND, if LiveCode could do that, I could just be lazy and get my sprite sheets from places like this:

https://itch.io/game-assets/free/tag-side-scroller

Re: Sprite sheets give me a headache

Posted: Sun Oct 10, 2021 7:13 pm
by richmond62
A lot better than Paracetemol:

https://github.com/bmarwane/spriteSplitter

Re: Sprite sheets give me a headache

Posted: Sun Oct 10, 2021 7:27 pm
by richmond62
SShot 2021-10-10 at 21.24.51.png
-
This, of course, is totally beside the point

[although it is rocky that I found something that chops up sprite sheets quicker than I can cut open
my thumb with a penknife.]

as it does NOT answer my original questions (either of them).

Re: Sprite sheets give me a headache

Posted: Mon Oct 11, 2021 7:01 am
by Kangaroo SW
Explore this :D

Re: Sprite sheets give me a headache

Posted: Mon Oct 11, 2021 8:13 am
by richmond62
Thank you very much Kangaroo SW:

1. Very clever.

2. No obvious benefit over using individual images

(just more complicated coding).

Re: Sprite sheets give me a headache

Posted: Mon Oct 11, 2021 4:23 pm
by jiml

Re: Sprite sheets give me a headache

Posted: Tue Oct 12, 2021 8:50 am
by richmond62
Screen Shot 2021-10-12 at 10.48.56 AM.png
Screen Shot 2021-10-12 at 10.48.56 AM.png (21.94 KiB) Viewed 6599 times
-
Thank you.

Very clever, very complicated and ALL for the sake of NOT chopping up a sprite sheet.

The effort, in my case at least, does not seem justified.

Re: Sprite sheets give me a headache

Posted: Tue Oct 12, 2021 11:29 am
by stam
richmond62 wrote:
Tue Oct 12, 2021 8:50 am
The effort, in my case at least, does not seem justified.
The main benefit as far as i can see is you're managing just 1 image instead of say 12 or 20. It does require extra effort in preparing the images to just one image, as all cells have to be the same size and all images have to be centred in that cell, but that's a 1-time job.

I'm not sure the output is any different/speedier, but when working with an app, managing just one image greatly simplifies things i suppose.

S.

Re: Sprite sheets give me a headache

Posted: Tue Oct 12, 2021 12:18 pm
by richmond62
all cells have to be the same size and all images have to be centred in that cell
These both seem disadvantages as with a series of images of differing dimensions on displaying them
in a graphic as a backGroundPattern one can reset the graphic;s dimensions to take the image
dimensions into account.

Sprites of this sort:

https://aamatniekss.itch.io/fantasy-kni ... r?download
-
_AttackNoMovement.png
_AttackNoMovement.png (1.69 KiB) Viewed 6546 times
-
have to be chopped up into individual images UNLESS jiml's Cel-animation
can be modded to change the dimensions of the group containing the sprite sheet for each frame.

Re: Sprite sheets give me a headache

Posted: Tue Oct 12, 2021 12:54 pm
by richmond62
As I am considering writing a leaflet not called "Making Side Scrolling Games for Morons", that is the title
I will be repeating under my breath.

Re: Sprite sheets give me a headache

Posted: Tue Oct 12, 2021 2:39 pm
by xAction
Your Warrior sprite doesn't need to change size for each sprite.
One Size to Rule them all
SpritesExample.png
SpritesExample.png (3.1 KiB) Viewed 6485 times
You can make SpriteSheets with ImageMagick
or cut it into pieces

The active part of that sprite is the sword
Is enemy character within the rect of the sprite container? Is sword attack animation active? Take damage.
Is enemy character within the rect of the sprite container? Are they left of the center? Are they attacking? Warrior dies!
Wawawa

Re: Sprite sheets give me a headache

Posted: Tue Oct 12, 2021 4:19 pm
by jiml
I did that years ago and not to avoid chopping a sprite sheet but to get blindingly fast animation in LiveCode.
You're welcome!

Re: Sprite sheets give me a headache

Posted: Tue Oct 12, 2021 5:41 pm
by richmond62
to get blindingly fast animation
Ah, I understand, but, nothing I ever do is blindingly fast. 8)
One Size to Rule them all
Not always!
-
Zombie.png
-
Great source: https://craftpix.net/