getScreen

inline fun <Type : ScreenType> getScreen(): Type

Returns cached instance of Screen of the selected type.

Return

an instance of Screen extending passed Type.

Parameters

Type

concrete class of the screen implementation. The screen instance of this type must have been added with addScreen before calling this method.

See also

Throws

GdxRuntimeException

if instance of the selected Type was not registered with addScreen.


open fun <Type : ScreenType> getScreen(type: Class<Type>): Type

Returns cached instance of Type of the selected type.

Return

an instance of Type extending passed type.

Parameters

type

concrete class of the screen implementation. The screen instance of this type must have been added with addScreen before calling this method.

See also

Throws

GdxRuntimeException

if instance of the selected type was not registered with addScreen.