CWindowMgr

You need to add this script by AddComponent in “Awake” method of CMainSystem.

This script manages windows.

All windows are created by this manager.

class CWindowMgr
void setUIResolution (Single width, Single height)
Param width

Sets the screen width of the UI. If the value is 0, the scaling factor is calculated relative to the height.

Param height

Sets the screen height of the UI.Only If width = 0, calculates the scaling factor with respect to the height.

Sets the screen height of the UI. Only if width = 0,calculates the scaling factor with respect to the height.

  • Case: width != 0

Determines the UI screen size relative to width.

  • Case: width = 0 and height != 0

Determines the UI screen size relative to height.

  • Case: width = 0 and height = 0(Default)

It conforms to the screen size of the terminal.

Boolean initialize (CAssetBundle[] aAB)

Expand and initialize the loaded window resource.If CassetBundleMgr is registered, it will automatically download the window resources from the server and pass them to this function.

Boolean load (Byte[] buffer)

Expands and initializes window resources loaded as byte data.

Boolean load (String assetname)
Param string assetname

Name of the imported asset

Loads and initializes the window resource with the specified asset name from the resource data.

The actual imported asset is named assetname + “.asset”.

WindowScript create<WindowScript> (UInt32 id, CWindowBase cParent = null)
The class name of the window to create.

The class name of the window to create.

Param uint id

Window ID

Param CWindowBase cParet

Parent window

Creates a window of the specified class.

WindowScript find<WindowScript> (UInt32 id)
The class name of the window to create.

Window class name

Param uint id

Window ID

Finds the specified window. If not yet created, null is returned.

void bringToTop (CWindowBase cWindow)
Param CWindowBase cWindow

target window

rise a priority of target window.

String getCaption (UInt32 mCaptionId)
Param uint mCaptionId

Caption ID

Gets the string from the specified caption ID.

void play (UInt32 mSE)
Param uint mSE

SE’s ID

Play the SE

UInt32 clickSE { get; set; }

Specifies a standard sound to be played when touched.

UInt32 scrollSE { get; set; }

Specifies a standard sound to be played when scrolling through a list box.

static CWindowMgr Instance { get; }

Gets an instance of a window manager.