iphoneSetRedrawInterval

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
iphoneSetRedrawInterval <frameInterval>
Associationsstack
Summary

Synchronizes LiveCode redraws with the device's refresh rate.

Introduced5.0
OSios
Platformsmobile
Parameters
NameTypeDescription
frameInterval

A number specifying how often LiveCode should update the screen in line with the screen's refresh rate.

"0": Turn off synchronized redraws and revert to default LiveCode redrawing behavior.
"1": Redraw every time iOS redraws.
"2": Redraw on every other iOS redraw.
"x": Redraw every x iOS redraws.
Example
iphoneSetRedrawInterval 1 -- Redraw with every iOS redraw request
iphoneSetRedrawInterval 2 -- Redraw on every other iOS redraw request
iphoneSetRedrawInterval 0 -- Don't use the redraw interval feature
RelatedProperty: compositorTileSize, layerMode, compositorType, compositorCacheLimit
Description

Use the iphoneSetRedrawInterval command to improve screen update performance and smoothness on iOS devices by tying LiveCode redraw calls to the device's refresh rate.

By default, LiveCode updates the screen immediately after any command that requires it. This means that several small screen updates may occur in quick succession when animation is combined with other dynamic screen elements. On mobile devices this can affect smoothness of animation where it would be better if multiple frequent redraws were replaced with a single periodic redraw. Setting the iphoneSetRedrawInterval enables this behaviour, where the screen is updated at a fixed interval tied to iOS's redraw rate.

WHEN TO USE This feature should be used for applications that cause the screen to be redrawn often or where redraws are being called by various application elements. For example, scrollers, dragging and the move command all independently request redraws causing a build up which can lead to 'judders' and other unwanted drawing issues.

Warning: When using this feature, updates do not occur after each command.

Warning: This feature should not be used if your scripts prevent system messages from being processed. For example, tight loops using the wait command. Screen redraws are dependent on LiveCode receiving iOS redraw calls.