- Main Page
- Classes
- Files

- File List
- File Members

# flSprite.h

Go to the documentation of this file.

    00001 // Funclib Sprite v1.0.0
    00002 //
    00003 // This module contains functions for using sprites.
    00004 // These are very useful in 2d games and games with complex huds.
    00005 // This module requires TEXTURE, also sprites must be drawn in ortho.
    00006 //
    00007 // Contributor(s): Flatmush
    00008
    00009
    00010
    00011 #ifndef FLSPRITE_H
    00012 #define FLSPRITE_H
    00013
    00014 #include "flGlobal.h"
    00015
    00016 #if FL_SPRITE != 0
    00017
    00018 #ifdef __cplusplus
    00019 extern "C" {
    00020 #endif
    00021
    00022 typedef struct {
    00023      Texture* spriteTex;
    00024      float    spriteX, spriteY;
    00025      int      spriteWidth, spriteHeight;
    00026      float    spriteAngle;
    00027      float    spriteScaleX, spriteScaleY;
    00028
    00029      int      spriteFrame;
    00030      int      spriteFrameCount;
    00031 } Sprite;
    00032
    00033 extern Sprite* spriteCreate(Texture* inTex, int inFrameWidth, int inFrameHeight);
    00034 extern void    spriteFree(Sprite* inSprite);
    00035 extern void    spriteRotate(Sprite* inSprite, float inAngle);
    00036 extern void    spriteResize(Sprite* inSprite, float inWidth, float inHeight);
    00037 extern void    spriteMove(Sprite* inSprite, int inX, int inY);
    00038 extern void    spriteMoveTo(Sprite* inSprite, int inX, int inY);
    00039 extern void    spriteDraw2d(Sprite* inSprite);
    00040 extern void    spriteDraw2dFrame(Sprite* inSprite, int inFrame);
    00041
    00042 #ifdef __cplusplus
    00043 }
    00044 #endif
    00045
    00046 #endif
    00047
    00048 #endif