1 2 #ifndef _FLOATTEXT_H 3 #define _FLOATTEXT_H 4 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) 8 9 enum FloatTextStates 10 { 11 FT_IDLE, 12 FT_RISE, 13 FT_HOLD, 14 FT_SCROLL_AWAY, 15 }; 16 17 class FloatText 18 { 19 public: 20 FloatText(int sprite); 21 ~FloatText(); 22 void Reset(); 23 24 void AddQty(int amt); 25 bool IsScrollingAway(); 26 27 void UpdatePos(Object *assoc_object); 28 29 static void DrawAll(); 30 static void DeleteAll(); 31 static void ResetAll(void); 32 33 bool ObjectDestroyed; 34 35 private: 36 void Draw(); 37 38 uint8_t state; 39 40 int yoff; // how much we've risen 41 int shownAmount; 42 int sprite; // allows selecting font 43 int timer; 44 45 SDL_Rect cliprect; 46 int objX, objY; // the center pixel of the associated object (de-CSFd) 47 48 49 FloatText *next, *prev; 50 static FloatText *first, *last; 51 }; 52 53 54 #endif 55 56