home *** CD-ROM | disk | FTP | other *** search
- #include <fastgraf.h>
- #include <string.h>
- #include "ndisplay.h"
- #include "viddir.h"
- #include "standard.h"
-
- NumericDisplay::NumericDisplay(Director* d,char* lib,int i,
- int m,int xx,int yy) : Performer(d)
- {
- value=i;
- x=xx;
- y=yy;
- max=m;
- strcpy(gfxlib,lib);
- }
-
- void NumericDisplay::initialize()
- {
- init_flag=FALSE;
- load_gfxfont(gfxlib);
- }
-
- void NumericDisplay::set(int v)
- {
- value=v;
- }
-
- void NumericDisplay::update()
- {
- if (!init_flag)
- {
- w=get_char_width('0')*max+5;
- h=get_char_height('0');
- init_flag=TRUE;
- }
- VideoDirector::restore_patch(x,y,x+w,y+h);
- show_number(x,y,value);
- VideoDirector::flush_patch(x,y,x+w,y+h);
- }
-
-