jjANIMFRAME class
A single frame of a sprite animation.
Reference-counted handle to one frame within the global animation frame table, exposing its dimensions and the hotspot, coldspot and gun-muzzle offsets used when the frame is drawn or aimed. Also provides pixel-perfect collision testing against another frame. Obtained via jjAnimFrames[index].
Public static functions
-
static auto get_jjAnimFrames(std::
uint32_t index) -> jjANIMFRAME* - Returns the animation frame at the specified global index.
Constructors, destructors, conversion operators
- jjANIMFRAME()
- Creates a new instance.
- ~jjANIMFRAME()
Public functions
- void AddRef()
- Increments the reference count.
- void Release()
- Decrements the reference count.
- auto operator=(const jjANIMFRAME& o) -> jjANIMFRAME&
- auto get_transparent() const -> bool
- Returns whether the frame contains transparency.
- auto set_transparent(bool value) const -> bool
- Sets whether the frame contains transparency.
-
auto doesCollide(std::
int32_t xPos, std:: int32_t yPos, std:: int32_t direction, const jjANIMFRAME* frame2, std:: int32_t xPos2, std:: int32_t yPos2, std:: int32_t direction2, bool always) const -> bool - Returns whether this frame collides with another frame at the given positions.
Public variables
- int16_t hotSpotX
- Horizontal hotspot offset.
- int16_t hotSpotY
- Vertical hotspot offset.
- int16_t coldSpotX
- Horizontal coldspot offset.
- int16_t coldSpotY
- Vertical coldspot offset.
- int16_t gunSpotX
- Horizontal gun muzzle offset.
- int16_t gunSpotY
- Vertical gun muzzle offset.
- int16_t width
- Frame width in pixels.
- int16_t height
- Frame height in pixels.