Scripts / Animating Sprites

Author
Message
Saintyboy
8
Years of Service
User Offline
Joined: 18th Jun 2015
Playing:
Posted: 30th Jul 2016 18:24
Hi folks, does anyone know the process of incorporating an animated sprite into a HUD - indeed can it be done? I can't seem to get Guru to accept APNG files.
smallg
Community Leader
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 31st Jul 2016 00:13
you would need to do it manually by moving the images on and off screen in order yourself.
something like this (x represents the number used to store the sprite slot, you will need to load the images as sprites before this code is run)
if x > 10 then --change 10 to the maximum number of frames
x = 1
else
x = x + 1
end
if x > 1 then
SetSpritePosition(x-1,200,200)
end
SetSpritePosition(x,90,90)
lua guide for GG
https://steamcommunity.com/sharedfiles/filedetails/?id=398177770
windows 10
i5 @4ghz, 8gb ram, AMD R9 200 series , directx 11
Saintyboy
8
Years of Service
User Offline
Joined: 18th Jun 2015
Playing:
Posted: 31st Jul 2016 01:37
Cheers smallg - seems like a reasonable work around - i'll give it go!
Bolt Action Gaming
GameGuru Tool Maker
10
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 1st Aug 2016 20:17
Why not create a file similar to a decal? Basically a sprite sheet then you use the fpe file to choose what kind of sprite it is (4x4, 8x8, etc) for animations. It wouldn't require any code at all.
Saintyboy
8
Years of Service
User Offline
Joined: 18th Jun 2015
Playing:
Posted: 2nd Aug 2016 19:22
Cheers Boltaction, not sure this will work because the hard coded routine is very particular about the type of file it imports for sprites - i.e must be png - I have tried an animated png (APNG) but Guru has none of it.

Login to post a reply

Server time is: 2024-05-03 22:41:24
Your offset time is: 2024-05-03 22:41:24