Difference between revisions of "Application:setFps"

From GiderosMobile
(→‎Description: fixed some html tags)
Line 1: Line 1:
__NOTOC__
+
'''Available since:''' Gideros 2012.2.2<br/>
<languages />
+
'''Class:''' [[Application]]<br/>
'''<translate>Available since</translate>:''' Gideros 2012.2.2
+
 
<br/>
+
=== Description ===
'''<translate>Class</translate>:''' [[Special:MyLanguage/Application|Application]]
 
<br/>
 
=== <translate>Description</translate> ===
 
<translate>
 
 
Sets the frame rate of the application. Accepted values are ''30'' and ''60''.
 
Sets the frame rate of the application. Accepted values are ''30'' and ''60''.
 +
 
<source lang="lua">
 
<source lang="lua">
 
application:setFps(fps)
 
application:setFps(fps)
 
</source>
 
</source>
<br/>
+
 
 +
 
 
You can also use setFps(-60) or setFps(-30) to maintain an apparent frame rate of 60 or 30 fps by skipping frames if the system notices it is running slow.
 
You can also use setFps(-60) or setFps(-30) to maintain an apparent frame rate of 60 or 30 fps by skipping frames if the system notices it is running slow.
<br/>
+
 
 
So for example, it updates the game logic 60 times per second but redraws the screen only 30 times per second.
 
So for example, it updates the game logic 60 times per second but redraws the screen only 30 times per second.
<br/>
+
 
 
The game is playable but will not be smooth on slow devices (currently available on WinRT).
 
The game is playable but will not be smooth on slow devices (currently available on WinRT).
</translate>
+
 
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''fps''': (number) <translate>the new frame rate of the application</translate>
+
'''fps''': (number) the new frame rate of the application<br/>
<br/>
+
 
<br/>
+
{{Application}}

Revision as of 00:36, 3 December 2019

Available since: Gideros 2012.2.2
Class: Application

Description

Sets the frame rate of the application. Accepted values are 30 and 60.

application:setFps(fps)


You can also use setFps(-60) or setFps(-30) to maintain an apparent frame rate of 60 or 30 fps by skipping frames if the system notices it is running slow.

So for example, it updates the game logic 60 times per second but redraws the screen only 30 times per second.

The game is playable but will not be smooth on slow devices (currently available on WinRT).

Parameters

fps: (number) the new frame rate of the application