The Menu Overlay is the main overlays it allow you to create HUD, Menus, Inventories, ETC... This is also what you will use to create web app with the EGE

How to Initialize the Menu Overlay?


To initialize the Menu Overlay simply call the function AddNewMenuOverlay from the GUI group.



Class Details


Functions:


       Initialization & Main Functions

Name

Arguments

Return

Description

Init

  • String: BaseID - HMTL ID defining the position in the DOM of the tab. (Automatically set by AddNewMenuOverlay).
  • String: RegistryName - Name that define this overlay, all children IDs will start by this.

VOID

This function Initialized every part of the viewer: HMTL, CSS, Data, Events, etc...

It will be generated in the defined ID and all HTML IDs used for this  will start by the RegistryName defined in arguments.

Launch

  • None

VOID

Launch all systems required by the this and will call all children launch.




Setters Functions

Name

Arguments

Return

Description

IsFillingViewport

  • Boolean: IsFilling - Specified if filling (See description)

VOID

Setup an Overlay IsFilling mean it cover the whole viewport, so it will lock all interaction behind it.


If you set it has fault all the interaction will go through (no more event on the overlay - in that case use ForceInteraction function to make it interactive).

SetBackgroundColor

  • Color: BG - Background Color

VOID

Setup the background color.

SetBackgroundImage

  • String: URL - link of the image
  • @Nullable Function: SBICallback - function called when the image is loaded.

VOID

Setup the background image.

Reset

  • None

VOID

Will destroy and remove everything in the overlay.


Design & Other Functions


Name

Arguments

Return

Description

AddWidget

  • WidgetType: Type - Define which widget you want.
  • String: Name - Name of this widgets.

Widgets

Will add a selected children widgets in itself and return it.


Note: The children will always they're IDs starting by the parent name, so time it's not in the same family you can add an identical name.

AddPopUp

  • String: Name - Name of this popup.

PopUp

Add a new PopUp window to the overlay.




Interaction Functions

Name

Arguments

Return

Description

Movable

  • Integer: WhichButton - The mouse button ID that will move the overlay.

VOID

This function will authorize the overlays to move freely on a 2D plane when the selected mouse button is hold.


This function will create all events and will change cursor type to grab  .

AddClick

  • Function: Down - function called when mouse down.
  • Function: Up - function called when mouse up.

VOID

Set the mouse down and up events.

AddMouseMove

  • Function: Func - function called when mouse moves.

VOID

Set the mouse move events.

AddInteractiveToolBox

  • Function: AITBCallback - function called when all EE modules are loaded.

InteractiveToolBox

Set an InteractiveToolBox working with this overlay (it return it for setters).



Linker Functions

Name

Arguments

Return

Description

CreateLink

Boolean

It create create a linker at Pos.


This linker will now be attached to the mouse.

Send back a Boolean if the linker has been created.

CancelLink

  • None

VOID

If the link is still active (still following cursor) then use this function to cancel this.

ValidateLink

Boolean

Will lock the linker on the defined position.

Send back a Boolean if the linker has been locked.

GetLinker

Linker

You can retrieved an existing linker by using it's position and offset position.

RemoveLinker

None

Will use the position and the offset position to find the linker then it will remove and destroy it.

ClearLinker

  • None

None

Will remove all linker.





Private Details



All private details are usable but its recommended to not use any of those. It might modify the proper functioning of the class.


Variables (Members):


       Main Members

Name

Type

Default Value

Description

id

String

undefined

Global HMTL Id of the viewer (# + name).

registryName

String

undefined

Name of this overlay.

basedId

String

undefined

Where it is located is the existing DOM (its parent).


Information

Name

Type

Default Value

Description

lastMousePos

Position

x: 0 and y: 0

Hold where the mouse in the last move.

shiftX

Integer

0

Hold the x shift the overlays made (When user is moving the overlay). It is used by widgets to recalculate position.

shiftX

Integer

0

Hold the y shift the overlays made (When user is moving the overlay). It is used by widgets to recalculate position.

isMoving

Boolean

false

Used to check if the overlay is moving.

mouseMoveButton

Integer

2

Used to defined which mouse button make the overlay moving


       Widgets

Name

Type

Default Value

Description

AllWidget

Widgets[]

[]

Array holding all the Widgets in the overlay.

lastZIndex

Integer

false

To make sure the Widgets are properly layered we decrement this variable each widgets.



Linker

Name

Type

Default Value

Description

allLinker

Linker[]

[]

Array holding all the Linker in the overlay.

lastLinkerID

Integer

0

To make sure the Linker are properly layered we increment this variable each widgets.

doesLinkerActive

Boolean

false

Used to check if a Linker is moving with the cursor.



Tool Box

Name

Type

Default Value

Description

toolBox

toolBox

null

Hold the active toolbox set by AddInteractiveToolBox.

toolBoxIsOpen

Boolean

false

Used to check if toolBox is open.



Functions:        

Interaction Functions

Name

Arguments

Return

Description

MoveAll

  • None

None

This function is called when the overlay is moving to move all overlays components.



Linker Functions

Name

Arguments

Return

Description

MouseMove

  • JS Event Class: e

None

This function is called when the mouse is moving and a linker is active to make it follow it.


Util Functions

Name

Arguments

Return

Description

GetLinkersID

  • None

String

Return the linker div ID.

Compatibility



LANGUAGE CLASS: Not compatible.

Created with the Personal Edition of HelpNDoc: Free Kindle producer