composer.getSceneName()

Type Function
Library composer.*
Return value String
Revision Release 2022.3683
Keywords composer, scene, getSceneName
See also composer.gotoScene()
composer.removeScene()

Overview

Returns the current, previous, or overlay scene name as a string. This can then be used with composer.gotoScene() or composer.removeScene().

Syntax

composer.getSceneName( sceneType )
sceneType (required)

String. The name of the scene you want to retrieve. Possible values are "current", "previous", or "overlay".

Examples

local prevScene = composer.getSceneName( "previous" )

-- Later...
composer.gotoScene( prevScene )
local currScene = composer.getSceneName( "current" )

composer.removeScene( currScene )