NXEngine v1.0.0.6
[NXEngine.git] / floattext.h
blob8a7b96e6b072e6720a991c5db22f60260ad306f2
2 #ifndef _FLOATTEXT_H
3 #define _FLOATTEXT_H
5 #define FT_Y_START -4 // this starts it exactly centered, since the font is 8px tall
6 #define FT_Y_HOLD -19
7 #define FT_Y_RISEAWAY (FT_Y_HOLD - 8)
9 enum FloatTextStates
11 FT_IDLE,
12 FT_RISE,
13 FT_HOLD,
14 FT_SCROLL_AWAY,
17 class FloatText
19 public:
20 FloatText(int sprite);
21 ~FloatText();
22 void Reset();
24 void AddQty(int amt);
25 bool IsScrollingAway();
27 void UpdatePos(Object *assoc_object);
29 static void DrawAll();
30 static void DeleteAll();
31 static void ResetAll(void);
33 bool ObjectDestroyed;
35 private:
36 void Draw();
38 uint8_t state;
40 int yoff; // how much we've risen
41 int shownAmount;
42 int sprite; // allows selecting font
43 int timer;
45 SDL_Rect cliprect;
46 int objX, objY; // the center pixel of the associated object (de-CSFd)
49 FloatText *next, *prev;
50 static FloatText *first, *last;
54 #endif