Difference between revisions of "Event.ENTER FRAME"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Value:''' enterFrame<br/>
'''<translate>Value</translate>:''' enterFrame<br/>
+
'''Defined by:''' [[Sprite]]<br/>
'''<translate>Defined by</translate>:''' [[Special:MyLanguage/Sprite|Sprite]]<br/>
+
 
=== <translate>Descriptio</translate>n ===
+
=== Description ===
<translate>The Gideros runtime dispatches the built-in [[Special:MyLanguage/Event.ENTER_FRAME|Event.ENTER_FRAME]] event to [[Special:MyLanguage/Sprite|Sprite]] instances before rendering the screen. Visual changes made by any [[Special:MyLanguage/Event.ENTER_FRAME|Event.ENTER_FRAME]] listener function will be visible at next frame.</translate>
+
The Gideros runtime dispatches the built-in '''Event.ENTER_FRAME''' event to [[Sprite]] instances before rendering the screen. Visual changes made by any '''Event.ENTER_FRAME''' listener function will be visible at next frame.
=== <translate>Parameters</translate> ===
+
 
'''deltaTime''': (number) <translate>time passed from previous frame</translate><br/>
+
=== Parameters ===
'''time''': (number) <translate>time passed from app start</translate><br/>
+
'''deltaTime''': (number) time passed from previous frame<br/>
'''frameCount''': (number) <translate>frame count from app start</translate><br/>
+
'''time''': (number) time passed from app start<br/>
 +
'''frameCount''': (number) frame count from app start<br/>
 +
 
 +
=== Example ===
 +
<syntaxhighlight lang="lua">
 +
function onEnterFrame(e)
 +
print(e.deltaTime)
 +
end
 +
 
 +
stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)
 +
</syntaxhighlight>
 +
 
 +
{{Sprite}}

Latest revision as of 14:26, 13 July 2023

Available since: Gideros 2011.6
Value: enterFrame
Defined by: Sprite

Description

The Gideros runtime dispatches the built-in Event.ENTER_FRAME event to Sprite instances before rendering the screen. Visual changes made by any Event.ENTER_FRAME listener function will be visible at next frame.

Parameters

deltaTime: (number) time passed from previous frame
time: (number) time passed from app start
frameCount: (number) frame count from app start

Example

function onEnterFrame(e)
	print(e.deltaTime)
end

stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)