Scripts / Animated Sprites?

Author
Message
GubbyBlips
5
Years of Service
User Offline
Joined: 14th Jan 2019
Location:
Posted: 15th Oct 2020 02:15
Looked over the forums on animating sprites [decals], seems there's no
real lua function to set the animations?

So... is the only Sprite animation control --
a sprite you want to animate differently under different circumstances--
is only possible by (if you acquire a Decal Sheet), split it up into separate
slices, and place them manually on the screen?
True? or is there a better way?!
PM
3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 15th Oct 2020 06:02
There is no sprite animation GG Lua command to animate sprites, at least I don't know any.

Anyway, you can loop your images to get the animation. Forget sliding layers in a sprite sheet, think most in some sort of images to reproduce the animation, such as an animated gif file work.
Save these images in scriptbank>images>your folder name.
For instance, if you have 18 images then the images should be labeled from 000 thru 017.png.
Sometimes you will have to play with the alpha channel to get a transparent background as I did in the video below with the diamond.



Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 15th Oct 2020 10:23
yep you have to split the sheet up for doing it manually - decals or particles can use spritesheets
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11

Login to post a reply

Server time is: 2024-12-22 02:54:16
Your offset time is: 2024-12-22 02:54:16