1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
#ifndef BUTTON_INCLUDED
#define BUTTON_INCLUDED
#include "GridSpace.h"
class Button {
public:
// constructs w/ center location on screen and a string label
// if label is 1 or 2 characters, drawn with big font
// if 3 or 4 chars, drawn with little font
Button( int inX, int inY, char *inString );
~Button();
// resets string
// smooth transition
void setString( char *inString );
// instant transtition
void forceString( char *inString );
char isInside( int inX, int inY );
void setVisible( char inIsVisible );
char isVisible() {
return mVisible;
}
// forces to become completely visible instantly
void forceVisible();
void forceInvisible();
// steps animations
void step();
// draws onto screen
void draw();
int mX, mY;
char *mString;
private:
GridSpace mSpace;
char mVisible;
float mFadeProgress;
char *mLastString;
float mStringTransitionProgress;
};
#endif
|