[Super-tux-commit] supertux/lib/gui mousecursor.h,1.1,1.2
Brought to you by:
wkendrick
From: Tobias G. <to...@us...> - 2004-07-20 19:41:42
|
Update of /cvsroot/super-tux/supertux/lib/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12525/lib/gui Modified Files: mousecursor.h Log Message: added comments Index: mousecursor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/mousecursor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mousecursor.h 20 Jul 2004 17:51:35 -0000 1.1 +++ mousecursor.h 20 Jul 2004 19:41:29 -0000 1.2 @@ -35,17 +35,34 @@ MC_HIDE }; +/// Mouse cursor. +/** Used to create mouse cursors. + The mouse cursors can be animated + and can be used in four different states. + (MC_NORMAL, MC_CLICK, MC_LINK or MC_HIDE) */ class MouseCursor { public: + /// Constructor of MouseCursor. + /** Expects an imagefile for the cursor and the number of animation frames it contains. */ MouseCursor(std::string cursor_file, int frames); ~MouseCursor(); + /// Get MouseCursor state. + /** (MC_NORMAL, MC_CLICK, MC_LINK or MC_HIDE) */ int state(); + /// Set MouseCursor state. + /** (MC_NORMAL, MC_CLICK, MC_LINK or MC_HIDE) */ void set_state(int nstate); + /// Define the middle of a MouseCursor. + /** Useful for cross mouse cursor images in example. */ void set_mid(int x, int y); + + /// Draw MouseCursor on screen. void draw(DrawingContext& context); + /// Return the current cursor. static MouseCursor* current() { return current_; }; + /// Set current cursor. static void set_current(MouseCursor* pcursor) { current_ = pcursor; }; private: |