Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / GIFS vs PNG for sprites on phones.

Author
Message
Thomas John Gorham
6
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 21st Sep 2020 00:31
Hey Guys,

For the game I am making, I started making a mainmenu animation.

It works fine on PC, but when broadcasting to a phone, the PNG animation is too large (21 frames of 640x480 so it gets resized and then I get the "file is not large enough to have that many frames").

It works if I make the file a GIF, but then none of the animation commands work, it just keeps looping over and over. I need it to loop once and stop, like when you set the iloop to 0 in Playsprite()

Any ideas what to do?
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 21st Sep 2020 06:35 Edited at: 21st Sep 2020 06:41
care to paste the gif, here? i'm wondering if most of it can be done in code (without the overhead of 21 images).

otherwise, you can load the 21 images (separately) and write your own simple "animation" code? something like:


add: the last time i created a .gif in PS, i thought there was an option to play once, or loop. are you saying that you've set your gif to play once on creation but AppGameKit is looping it?
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
Thomas John Gorham
6
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 21st Sep 2020 10:53 Edited at: 21st Sep 2020 10:54
I made it in Aseprite, the loop options are forward, reverse and pingpong.

When A sprite is made with this gif, it just keeps playing.

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 21st Sep 2020 20:17
Im on my phone for the next bunch of hours but confident that menu can b put together with text objects/a lot less than 21x640x480.

If u/no one else puts an example together by the time i get home tonight, i will (unless i get too much overtime, in which case its still a "probably")
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
Thomas John Gorham
6
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 22nd Sep 2020 01:41
OHHHHH Do you mean put the individual letters up as a sprite each?

I just made the whole screen as 1 sprite.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Sep 2020 03:32 Edited at: 22nd Sep 2020 17:36
Quote: "put the individual letters up as a sprite each?"

technically, yes. but, using the Text set of commands. and, probably the Char & Text Tweening commands.

this will be my first time playing with tweens so it might take a bit; feel free to try for yourself while i try to put something together. but, once you review the commands, you'll see why i think this is a good way to go

ok, back with a simple example:


it's kinda crude but you get it. and, i don't think it needed Tweens after all.

ShotImg attached (even tho i think you already have the same )
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]

Attachments

Login to view attachments
Thomas John Gorham
6
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 24th Sep 2020 12:25
Your code is so neat

I like the use of the sleep command to get the timing for

I think I will use the letters Ive drawn as I got attached to them drawing them ahha, But I will use the sleep command for making the timing manual

Thanks for the help again
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 25th Sep 2020 04:00
Quote: " I will use the letters Ive drawn"

of course!

i was only trying to give you an idea on how else you might go about your menu idea vs 21x640x480.

and, i was tempted to add appropriate sound effects but i'll wait for your version
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
Thomas John Gorham
6
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 14th Nov 2020 11:49 Edited at: 14th Nov 2020 11:50
Hey guys,

another issue with file sizes on phones.


I spent a long time drawing a gorilla boss for my game. The file is too large for when I broadcast to android.

Is there a way to load larger files in AppGameKit? Or should I just delete half of the frames for facing right and just mirror the sprite?

Attachments

Login to view attachments
n00bstar
20
Years of Service
User Offline
Joined: 9th Feb 2004
Location: Montreal, Canada.
Posted: 11th Jan 2021 10:42
You're going at it the wrong way in many aspects:

1- If half of your frames are flipped versions of other frames, do it in software with SetSpriteFlip(). That will cut the size of your file in half

2-Don't put your frames like this:

1 2 3 4 5 6 7 8 9

Put them like this:

1 2 3
4 5 6
7 8 9

It will load just fine. Otherwise you will get a super long image and a lot of platforms don't like that. Even if it runs on PC, it's not recommended and will most likely give you problems down the road. Right now it stands at 10080 pixels wide, which is absolutely crazy. Try to stay below 2000ish.

3- You saved your file in 32 bit format. That's way overkill for an image with so few colors. Use indexed colors instead. This will cut the size of your file by A LOT.
Thomas John Gorham
6
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 11th Jan 2021 12:18
Thanks!

I learnt about setspriteflip() at the very end of my project haha. But next project will certainly be all over that

Login to post a reply

Server time is: 2024-11-17 22:21:53
Your offset time is: 2024-11-17 22:21:53