OnClientRestore: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "Category:Incomplete Event {{Client event}} __NOTOC__ This event is triggered when the local player restores the game screen from a previously minimized state. ==Parameters=...")
 
No edit summary
Line 6: Line 6:
==Parameters==
==Parameters==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool clearedRenderTargets
bool didClearRenderTargets
</syntaxhighlight>
</syntaxhighlight>
*'''clearedRenderTargets:''' A bool specifying whether all script created render targets have been cleared as part of the restore process. Generally, restoring in full screen mode will clear all render targets.
*'''didClearRenderTargets:''' A bool specifying whether all render targets have been cleared as part of the restore process. Generally, restoring in full screen mode will clear render targets.


==Example==
==Example==
This example shows how to cope with life's little upsets  
This example shows how to cope with life's little upsets  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function handleRestore(clearedRenderTargets)
function handleRestore( didClearRenderTargets )
     if clearedRenderTargets then
     if didClearRenderTargets then
         -- Do any work here to restore render target contents as required
         -- Do any work here to restore render target contents as required
     end
     end

Revision as of 02:38, 5 August 2011

This event is triggered when the local player restores the game screen from a previously minimized state.

Parameters

bool didClearRenderTargets
  • didClearRenderTargets: A bool specifying whether all render targets have been cleared as part of the restore process. Generally, restoring in full screen mode will clear render targets.

Example

This example shows how to cope with life's little upsets

function handleRestore( didClearRenderTargets )
    if didClearRenderTargets then
        -- Do any work here to restore render target contents as required
    end
end
addEventHandler("onClientRestore",getLocalPlayer(),handleRestore)

See Also

Other client events


Client event functions