|
@@ -1,7 +1,7 @@
|
|
#include "Timer.h"
|
|
#include "Timer.h"
|
|
#include "Spiel.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 )
|
|
: GameObject( TIMER, x, y, 0, 0 )
|
|
{
|
|
{
|
|
this->id = id;
|
|
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;
|
|
currentTime = (float)maxZeit;
|
|
sichtbar = visible;
|
|
sichtbar = visible;
|
|
this->autoWiederhohlung = autoWiederhohlung;
|
|
this->autoWiederhohlung = autoWiederhohlung;
|
|
|
|
+ tr.setSchriftSize( 12 );
|
|
|
|
+ tr.setSchriftZ( zSchrift->getThis() );
|
|
this->runns = runns;
|
|
this->runns = runns;
|
|
this->pause = 0;
|
|
this->pause = 0;
|
|
this->farbe = farbe;
|
|
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 )
|
|
void Timer::setZeit( float zeit )
|
|
{
|
|
{
|
|
currentTime = zeit;
|
|
currentTime = zeit;
|