Difference between revisions of "GetGameTime"

From King Arthur's Gold Wiki
Jump to: navigation, search
 
Line 8: Line 8:
 
Example from Entities/Characters/Scripts/BuilderAnim.as:
 
Example from Entities/Characters/Scripts/BuilderAnim.as:
 
<syntaxhighlight lang="cpp" highlight="4">
 
<syntaxhighlight lang="cpp" highlight="4">
Vec2f> p = this.getBlob().getPosition() + Vec2f(0.0f, -this.getBlob().getHeight() * 2.0f);
+
Vec2f p = this.getBlob().getPosition() + Vec2f(0.0f, -this.getBlob().getHeight() * 2.0f);
 
position2di pos = getDriver().getScreenPosFromWorldPos( p );
 
position2di pos = getDriver().getScreenPosFromWorldPos( p );
 
pos.X -= 16;
 
pos.X -= 16;

Latest revision as of 13:35, 26 August 2012

Returns the game time (number of ticks) as an integer (s32).

s32 getGameTime()

Example from Entities/Characters/Scripts/BuilderAnim.as:

Vec2f p = this.getBlob().getPosition() + Vec2f(0.0f, -this.getBlob().getHeight() * 2.0f);
position2di pos = getDriver().getScreenPosFromWorldPos( p );
pos.X -= 16;
pos.Y += -3 + Maths::FastSin(getGameTime()/4.5f)*3.0f;GUI::DrawIcon( "GUI/PartyIndicator.png", 2, dimension2di(16, 16), pos, getCamera().targetDistance );