Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
WorkspaceWidget Interface Reference

WorkspaceWidget class. More...

Inheritance diagram for WorkspaceWidget:
[legend]

Public Member Functions

proto external void SetFocusedWidget (Widget newFocus, bool noCrossFase=false)
 Sets focus (necessary when using keyboard/joyped) to a particular widget.
 
proto external Widget GetFocusedWidget ()
 Returns focused widget in this workspace.
 
proto external Widget GetModal ()
 Gets the only top Widget, which receives events.
 
proto external void AddModal (Widget modalRoot, Widget newFocus)
 Adds given Widget on top as a modal widget.
 
proto external bool RemoveModal (Widget modalRoot)
 Removes given Widget from list of modal widgets.
 
proto external int GetWidth ()
 Returns Current render-target width.
 
proto external int GetHeight ()
 Returns Current render-target height.
 
proto external vector ProjWorldToScreen (vector pos, BaseWorld world, int cam=-1)
 Projects world position to screen position in reference resolution.
 
proto external vector ProjScreenToWorld (float x, float y, out vector outDir, BaseWorld world, int cam=-1)
 Projects screen position in reference resolution to world position and direction.
 
proto external vector ProjWorldToScreenNative (vector pos, BaseWorld world, int cam=-1)
 Works just like.
 
proto external vector ProjScreenToWorldNative (float x, float y, out vector outDir, BaseWorld world, int cam=-1)
 Works just like.
 
proto external float DPIScale (float valueInReferenceResolution)
 Scale value from reference to current resolution.
 
proto external float DPIUnscale (float valueInScaledResolution)
 Scale value from current to reference resolution.
 
proto external Widget CreateWidget (WidgetType type, WidgetFlags flags, Color color, int sort, Widget parentWidget=NULL)
 Create widgets by WidgetType, null Color means full alpha white.
 
proto external Widget CreateWidgetInWorkspace (WidgetType type, int left, int top, int width, int height, WidgetFlags flags, Color color, int sort)
 Create widget in this workspace, null Color means full alpha white.
 
proto Widget CreateWidgets (ResourceName layoutResourceName, Widget parentWidget=NULL)
 Create widgets from *.layout file.
 
- Public Member Functions inherited from RTTextureWidget
proto external void SetGUIWidget (IEntity ent, int index)
 Sets Widget of type RTTextureWidgetTypeID, to which it is possible to reference in shader as $rendertarget it is possible to use only after object selection.
 
- Public Member Functions inherited from Widget
proto external void Update ()
 
proto external Widget GetParent ()
 Returns parent in hierarchy, or NULL.
 
proto external Widget GetChildren ()
 Returns children in hierarchy, or NULL.
 
proto external Widget GetSibling ()
 Returns next sibling in hierarchy, or NULL.
 
proto external void AddChild (notnull Widget child)
 Adds given widget as a child. Possible only if this widget accepts more children.
 
proto external void RemoveChild (notnull Widget child)
 
proto external void SetName (string name)
 
proto external string GetName ()
 
proto external void SetUserID (int id)
 Sets user ID.
 
proto external int GetUserID ()
 Gets user ID.
 
proto external bool IsFocusable ()
 
proto external void AddHandler (ScriptedWidgetEventHandler eventHandler)
 Add (hook) handler to widget. Adds reference to the handler.
 
proto external void RemoveHandler (ScriptedWidgetEventHandler eventHandler)
 Unhook handler from widget. Release reference to the handler.
 
proto external int GetNumHandlers ()
 Return number of all handlers attached to widget (C++ & scripted)
 
proto external ScriptedWidgetEventHandler GetHandler (int index)
 return widget event handler on given index, when the event handler is not inherited from ScriptedWidgetEventHandler, null is returned
 
proto external ScriptedWidgetEventHandler FindHandler (TypeName type)
 return first widget event handler of given type, when none of event handlers has the type null is returned
 
proto external void SetVisible (bool show)
 Sets visibility of this widget (VISIBLE flag)
 
proto external void SetEnabled (bool enable)
 Sets enabled state of this widget (DISABLED flag)
 
proto external bool IsVisible ()
 Returns whether is this widget visible (VISIBLE flag is set)
 
proto external bool IsVisibleInHierarchy ()
 Returns whether are this widget and all its ancesstors visible (VISIBLE flag is set)
 
proto external bool IsEnabled ()
 Returns whether is this widget enabled (DISABLED flag is not set)
 
proto external bool IsEnabledInHierarchy ()
 Returns whether are this widget and all its ancesstors enabled (DISABLED flag is not set)
 
proto external bool IsClippingChildren ()
 Returns wheter this widget clips its children.
 
proto external bool GetIsColorInherited ()
 
proto external void SetIsColorInherited (bool isColorInherited)
 Sets whether this widget inherits color from its parent.
 
proto external void SetColor (notnull Color color)
 Sets color of this widget.
 
proto external void SetColorInt (int color)
 Set ARGB color.
 
proto external int GetColorInt ()
 
proto external void SetOpacity (float alpha)
 Sets opacity which applies to this widget and all its descendants.
 
proto external float GetOpacity ()
 
proto external void SetZOrder (int zOrder)
 Changes z-order value.
 
proto external int GetZOrder ()
 Higher values mean more in front.
 
proto external void RemoveFromHierarchy ()
 Removes this widget from its parent and from the WidgetManager.
 
proto external Widget FindWidget (string pathname)
 Find Widget by path. e.g FindWidget("widget1.widget2.widget3.mywidget")
 
proto external Widget FindAnyWidget (string pathname)
 Looks for a widget with given name in this widget's children.
 
proto external Widget FindAnyWidgetById (int user_id)
 Find Widget by userID.
 
proto external string GetStyleName ()
 
proto external bool RemoveCallback (int eventId, int callbackId)
 
proto external bool RemoveCallbackByOwner (int eventId, Class owner)
 
proto external bool EmitCallback (int eventId)
 
proto external WorkspaceWidget GetWorkspace ()
 
proto ref Color GetColor ()
 Returns color of this widget.
 
proto string GetNavigation (WidgetNavigationDirection direction, out WidgetNavigationRuleType rule)
 Gets navigation rule for given direction.
 
proto external void SetNavigation (WidgetNavigationDirection direction, WidgetNavigationRuleType rule, string explicitTarget=string.Empty)
 Sets navigation rule for given direction.
 
proto external string GetTypeName ()
 
proto external int GetFlags ()
 
proto external int SetFlags (int flags)
 Sets given WidgetFlags for this widget.
 
proto external int ClearFlags (int flags)
 Removes all flags.
 
proto external WidgetType GetTypeID ()
 
proto void GetScreenPos (out float x, out float y)
 Returns position of this widget's top left corner in DPI scaled resolution.
 
proto void GetScreenSize (out float width, out float height)
 Returns size of this widget in DPI scaled resolution.
 
proto int AddCallback (int eventId, WidgetEventCallback fn)
 Add callback for given event id and returns callback id.
 
- Public Member Functions inherited from Managed
proto external ref Managed Clone ()
 Return shallow copy of object, or null if it is not allowed (not public constructor)
 

Detailed Description

WorkspaceWidget class.

Member Function Documentation

◆ AddModal()

proto external void WorkspaceWidget.AddModal ( Widget  modalRoot,
Widget  newFocus 
)

Adds given Widget on top as a modal widget.

Parameters
modalRootWidget to add as a modal widget
newFocusWidget to set as a new focus. If null, focus is set to first control element in modalRoot.

◆ CreateWidget()

proto external Widget WorkspaceWidget.CreateWidget ( WidgetType  type,
WidgetFlags  flags,
Color  color,
int  sort,
Widget  parentWidget = NULL 
)

Create widgets by WidgetType, null Color means full alpha white.

◆ CreateWidgetInWorkspace()

proto external Widget WorkspaceWidget.CreateWidgetInWorkspace ( WidgetType  type,
int  left,
int  top,
int  width,
int  height,
WidgetFlags  flags,
Color  color,
int  sort 
)

Create widget in this workspace, null Color means full alpha white.

◆ CreateWidgets()

proto Widget WorkspaceWidget.CreateWidgets ( ResourceName  layoutResourceName,
Widget  parentWidget = NULL 
)

Create widgets from *.layout file.

◆ DPIScale()

proto external float WorkspaceWidget.DPIScale ( float  valueInReferenceResolution)

Scale value from reference to current resolution.

◆ DPIUnscale()

proto external float WorkspaceWidget.DPIUnscale ( float  valueInScaledResolution)

Scale value from current to reference resolution.

◆ GetFocusedWidget()

proto external Widget WorkspaceWidget.GetFocusedWidget ( )

Returns focused widget in this workspace.

◆ GetHeight()

proto external int WorkspaceWidget.GetHeight ( )

Returns Current render-target height.

◆ GetModal()

proto external Widget WorkspaceWidget.GetModal ( )

Gets the only top Widget, which receives events.

◆ GetWidth()

proto external int WorkspaceWidget.GetWidth ( )

Returns Current render-target width.

◆ ProjScreenToWorld()

proto external vector WorkspaceWidget.ProjScreenToWorld ( float  x,
float  y,
out vector  outDir,
BaseWorld  world,
int  cam = -1 
)

Projects screen position in reference resolution to world position and direction.

Parameters
xCoordinate on screen in reference resolution
yCoordinate on screen in reference resolution
outDirReturned direction vector
camWhich camera to use for projection. If '-1', current camera from current world is used.
Returns
World coordinates

◆ ProjScreenToWorldNative()

proto external vector WorkspaceWidget.ProjScreenToWorldNative ( float  x,
float  y,
out vector  outDir,
BaseWorld  world,
int  cam = -1 
)

Works just like.

See also
ProjScreenToWorld but takes x and y in native (current) not reference resolution

◆ ProjWorldToScreen()

proto external vector WorkspaceWidget.ProjWorldToScreen ( vector  pos,
BaseWorld  world,
int  cam = -1 
)

Projects world position to screen position in reference resolution.

Parameters
camWhich camera to use for projection. If '-1', current camera from current world is used.
Returns
Screen coordinates in reference resolution(x, y axes) and depth in world units(z axis)

◆ ProjWorldToScreenNative()

proto external vector WorkspaceWidget.ProjWorldToScreenNative ( vector  pos,
BaseWorld  world,
int  cam = -1 
)

Works just like.

See also
ProjWorldToScreen but returns x and y in native (current) not reference resolution

◆ RemoveModal()

proto external bool WorkspaceWidget.RemoveModal ( Widget  modalRoot)

Removes given Widget from list of modal widgets.

Parameters
modalRootWidget to remove from the list

◆ SetFocusedWidget()

proto external void WorkspaceWidget.SetFocusedWidget ( Widget  newFocus,
bool  noCrossFase = false 
)

Sets focus (necessary when using keyboard/joyped) to a particular widget.

Widget must have some inputs like button, listbox, checkbox, combobox etc.

Parameters
newFocusA widget to focus. Passing null results in no widget being focused in this workspace.

The documentation for this interface was generated from the following file: