Difference between revisions of "GetGameTime"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> Returns the game time (number of ticks) as an int. </onlyinclude> <syntaxhighlight lang="cpp"> int getGameTime() </syntaxhighlight> Example from Entities/Character...")
 
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
Returns the game time (number of ticks) as an int.
+
Returns the game time (number of ticks) as an integer (s32).
 
</onlyinclude>
 
</onlyinclude>
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
int getGameTime()
+
s32 getGameTime()
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
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;

Revision as of 14: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 );