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.

AppGameKit Studio Chat / [SOLVED] Animated PNG's

Author
Message
marvin944
10
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 17th Dec 2019 08:49
What would be the easiest way to integrate animated (weather) PNG's intp AppGameKit? It seems there is no native support for those...
Dutch

The author of this post has marked a post as an answer.

Go to answer

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Dec 2019 08:54
Do you mean 2D or 3D?
There is examples of each across the classic forum

PNGs is not an animated format but with that said
you can use a png to save a series of frames which
can be animated
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
marvin944
10
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 17th Dec 2019 09:42
APNG is a well known animated format.

https://ezgif.com/help/making-animated-png
Dutch
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Dec 2019 09:48 Edited at: 17th Dec 2019 09:51
apparently the forums don't know what to do with animated png files (i tried to show one here).

meanwhile, instead of contending with this, you might request animated .png support if it's easy enough (i think we can use animated .gifs?); it might help to mention that most all web browsers now support it.
G-Breaker WIP and Itch.io Page.

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Dec 2019 09:57
that is APNG and not PNG
APNG is not supported but PNG is

APNG is very specialist
PNG on the otherhand does not store any animation info

but you could convert a gif to an animation and save it as png
but it would be separated into frames on one flat image with
no layers

There is several programs that do this for example
https://www.nchsoftware.com/imageconverter/index.html?msclkid=304337eb23e51162bd656a1385c0b7eb


fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 17th Dec 2019 12:24 Edited at: 17th Dec 2019 12:29
This post has been marked by the post author as the answer.
Convert the APNG to a sprite sheet png

https://ezgif.com/gif-to-sprite

1)Up load your animated png ^^
2)press the convert button on the right and select sprite. (Convert to sprite sheet)
3) Select the tile layout Horizontal, vertical or a grid of your choosing then save the PNG sprite sheet.
4) Load that image into agk and put it on a sprite then use setpriteanimation() with the correct image size the you can use Playsprite() to play your animated png

The PNG sprite sheet is only a tiny bit bigger than the original animated png so no problem....it just works.

EDITED: to corrict my horrifac spellong
Loktofeit
AGK Developer
15
Years of Service
User Offline
Joined: 21st Jan 2009
Location: Sarasota, FL
Posted: 17th Dec 2019 13:43
What Bengismo said.

APNG has been around for about 15 years, but it relatively unsupported and mostly unheard of. For both development and final usage - unless you're making an APNG utility of some kind - it would be best to use a more common image format for both frames and the final animation.
ruckertheron
7
Years of Service
User Offline
Joined: 12th Nov 2016
Location:
Posted: 22nd Dec 2019 15:05 Edited at: 22nd Dec 2019 15:07



The way I would animate a png is very primitive compared to what Ive seen but Ive been doing it for years via DarkBasic Classic...

First define your images:
(I would name them like so: )
image (1).png
image (2).png
image (3).png
image (4).png
image (5).png
image (6).png

Note: If you select all your images (control-A) and rename the first one "image" or whatever you would like, then it automatically names the rest in sequential order in that format.
You can just change "image" for whatever you name it.




Not sure if it works.. It should but havent checked but this is kind of how I would work it.. They have AddSpriteAnimation() commands that can shorten the process but I haven't messed around with that method as of yet.

Login to post a reply

Server time is: 2024-04-26 10:13:24
Your offset time is: 2024-04-26 10:13:24