Jump to content

[REL] 50p's SpriteAnim lib


50p

Recommended Posts

Info:

SpriteAnim lib. Have you even wanted to make 2D animations in MTA with sprite sheets? Here is a library to help you out.

Here is a video to show you a few examples:

This resource is an example of how to use it. Want to use the lib in your own script? Just copy the c_SpriteAnim.lua file to your resource and add it to meta.xml.

How to use the lib:

To create your own animation you need to call SpriteAnim: new() function. Here are its parameters:

SpriteAnim: new( filename, x, y, width, height, uCount, vCount, fps )

* filename: path to the sprite sheet

* x, y: X and Y position of the animation on the screen

* width, height: exactly what it says (single sprite size is best)

* uCount, vCount: number of frames in a row and column (respectively)

* (optional) fps: frames per second (speed of the animation itself)

Additional tool:

Gif 2 Sprite is a tool that will let you create a sprite sheets from GIFs, so you can create animations for your server even easier!

Have a look yourself:

GIF2SPRITE_screenshot.png

Download:

SpriteAnim library: https://community.multitheftauto.com/index.php?p= ... ls&id=5832

Gif 2 Sprite tool: http://scripteditor.beta.mtasa.com/files/Gif2Sprite.zip

Link to comment

Thanks guys. I'd like to see people using it on their servers.

what is this for?

for what can i use it?

Sprite animation has been used in games for very long time. Most of the time it's used for 2D animations. Watch this video and hopefully you'll understand better

Link to comment

Very neat.

@xTravax this kind of thing is usually just for the user HUD. Think something like star fox with the animated windows coming up from Peppy. DO A BARREL ROLL!!!

You could do something like make an animation purchase shop and show all the previews in 2D.

You could make a platformer game for waiting players.

You could make animated cursors like RTS games use for shooting off nukes and such.

You could make unit pictures like in RTS that show a little animation loop of some sort.

You can make a Wolfenstein 3D type health display where the face gets bloodied up as you're dying.

Lots of uses...

Link to comment
  • 6 months later...

@ciber, the whole point is to use the sprite image. Since you can't simply draw .gif animation in MTA I made this sprite animation library. As you can see in the video I switch between sprites.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...