Difference between revisions of "Application:setFps"
From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight") |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
'''Available since:''' Gideros 2012.2.2<br/> | '''Available since:''' Gideros 2012.2.2<br/> | ||
+ | '''Class:''' [[Application]]<br/> | ||
+ | |||
=== Description === | === Description === | ||
− | + | Sets the frame rate of the application. Accepted values are ''30'' and ''60''. | |
− | Sets the frame rate of the application. Accepted values are | + | |
− | < | + | <syntaxhighlight lang="lua"> |
− | 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 30 times. The game is playable but will not be | + | application:setFps(fps) |
− | + | </syntaxhighlight> | |
− | + | ||
− | + | ||
+ | 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 === | === Parameters === | ||
− | '''fps''': (number) | + | '''fps''': (number) the new frame rate of the application<br/> |
+ | |||
+ | {{Application}} |
Latest revision as of 17:22, 12 July 2023
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
- Application:applyStyles
- Application:canOpenUrl
- Application:checkPermission
- Application:configureFrustum
- Application:enableDrawInfo
- Application:enableOnDemandDraw
- Application:exit
- Application:get
- Application:getApiVersion
- Application:getAppId
- Application:getBackgroundColor
- Application:getClipboard
- Application:getContentHeight
- Application:getContentWidth
- Application:getDeviceHeight
- Application:getDeviceInfo
- Application:getDeviceName
- Application:getDeviceOrientation
- Application:getDeviceSafeArea
- Application:getDeviceWidth
- Application:getFps
- Application:getKeyboardModifiers
- Application:getLanguage
- Application:getLocale
- Application:getLogicalBounds
- Application:getLogicalHeight
- Application:getLogicalScaleX
- Application:getLogicalScaleY
- Application:getLogicalTranslateX
- Application:getLogicalTranslateY
- Application:getLogicalWidth
- Application:getNativePath
- Application:getOrientation
- Application:getProjectProperties
- Application:getScaleMode
- Application:getScreenDensity
- Application:getTextureMemoryUsage
- Application:isPlayerMode
- Application:openUrl
- Application:requestPermissions
- Application:set
- Application:setBackgroundColor
- Application:setClipboard
- Application:setEventMerging
- Application:setFps
- Application:setFullScreen
- Application:setKeepAwake
- Application:setKeyboardVisibility
- Application:setLogicalDimensions
- Application:setOrientation
- Application:setScaleMode
- Application:setTextInput
- Application:setWindowSize
- Application:vibrate