|
@@ -1,7 +1,7 @@
|
|
|
#include "Timer.h"
|
|
|
#include "Spiel.h"
|
|
|
|
|
|
-Timer::Timer( int id, const char *name, int maxZeit, int x, int y, bool visible, bool autoWiederhohlung, bool runns, int farbe )
|
|
|
+Timer::Timer( Schrift *zSchrift, int id, const char *name, int maxZeit, int x, int y, bool visible, bool autoWiederhohlung, bool runns, int farbe )
|
|
|
: GameObject( TIMER, x, y, 0, 0 )
|
|
|
{
|
|
|
this->id = id;
|
|
@@ -10,6 +10,8 @@ Timer::Timer( int id, const char *name, int maxZeit, int x, int y, bool visible,
|
|
|
currentTime = (float)maxZeit;
|
|
|
sichtbar = visible;
|
|
|
this->autoWiederhohlung = autoWiederhohlung;
|
|
|
+ tr.setSchriftSize( 12 );
|
|
|
+ tr.setSchriftZ( zSchrift->getThis() );
|
|
|
this->runns = runns;
|
|
|
this->pause = 0;
|
|
|
this->farbe = farbe;
|
|
@@ -75,6 +77,14 @@ void Timer::tick( double time, Spiel *zSpiel )
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void Timer::render( Bild &rObj )
|
|
|
+{
|
|
|
+ w = (float)tr.getTextBreite( Text( (int)( currentTime * 100 ) / 100.0 ) );
|
|
|
+ h = (float)tr.getTextHeight( Text( (int)( currentTime * 100 ) / 100.0 ) );
|
|
|
+ if( sichtbar && runns )
|
|
|
+ tr.renderText( (int)x, (int)y, Text( (int)( currentTime * 100 ) / 100.0 ), rObj, farbe );
|
|
|
+}
|
|
|
+
|
|
|
void Timer::setZeit( float zeit )
|
|
|
{
|
|
|
currentTime = zeit;
|