Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ImageWidget Interface Reference
Inheritance diagram for ImageWidget:
[legend]

Public Member Functions

proto external bool SetImage (int num)
 Switches to another image, if it's loaded.
 
proto external int GetImage ()
 Returns active image.
 
proto external bool LoadImageFromSet (int num, ResourceName resource, string imageName, bool noCache=false)
 Loads image form image set.
 
proto external void SetImageTexture (int image, notnull RTTextureWidget texture)
 
proto external bool LoadMaskTexture (ResourceName resource)
 Loads texture as mask used for alpha masking.
 
proto external bool LoadMaskFromSet (ResourceName resource, string imageName)
 Loads image form image set as mask used for alpha masking.
 
proto external void SetUV (float uv[4][2])
 When WF_CUSTOMUV is set, we can supply our own UV coords instead of computed ones.
 
proto external void SetRotation (float angle)
 Sets rotation of widget around defined center.
 
proto external float GetRotation ()
 Returns rotation of widget in degrees.
 
proto external void SetPivot (float x, float y)
 Sets pivot around which the widget will rotate.
 
proto external float GetMaskProgress ()
 Progress determines which alpha values are opaque using the mask.
 
proto external void SetMaskProgress (float value)
 See GetMaskProgress for explanation.
 
proto external float GetMaskTransitionWidth ()
 Transition width 0.1 and progress 0.2 mean that values in mask lower than progress will be opaque.
 
proto external void SetMaskTransitionWidth (float value)
 See GetMaskTransitionWidth for transition width explanation.
 
proto external ImageMaskMode GetMaskMode ()
 
proto external void SetMaskMode (ImageMaskMode maskMode)
 
proto external float GetMaskRange ()
 Valid only if the image mask is in range mode.
 
proto external void SetMaskRange (float range)
 
proto external float GetSaturation ()
 
proto external void SetSaturation (float saturation)
 
proto bool LoadImageTexture (int num, ResourceName resource, bool noCache=false, bool fromLocalStorage=false)
 Loads image.
 
proto external vector GetShadowOffset ()
 Returns offset of the image shadow. Z coordinate is not used (always 0)
 
proto external void SetShadowOffset (float x, float y)
 
proto ref Color GetShadowColor ()
 
proto external void SetShadowColor (notnull Color color)
 
proto void GetImageSize (int image, out int x, out int y)
 Returns size of image.
 
proto external vector GetSize ()
 Returns user defined size used in "Size to content" scenarios.
 
proto external void SetSize (float width, float height)
 Sets user defined size used in "Size to content" scenarios.
 
- 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)
 

Member Function Documentation

◆ GetImage()

proto external int ImageWidget.GetImage ( )

Returns active image.

◆ GetImageSize()

proto void ImageWidget.GetImageSize ( int  image,
out int  x,
out int  y 
)

Returns size of image.

◆ GetMaskMode()

proto external ImageMaskMode ImageWidget.GetMaskMode ( )

◆ GetMaskProgress()

proto external float ImageWidget.GetMaskProgress ( )

Progress determines which alpha values are opaque using the mask.

For progress x, pixels with alpha in mask < x will be opaque and alpha in mask > x will be transparent. For smooth transition see GetMaskTransitionWidth.

Returns
Progress from 0 to 1 representing alpha range which is visible in the mask

◆ GetMaskRange()

proto external float ImageWidget.GetMaskRange ( )

Valid only if the image mask is in range mode.

Returns
Range of the the mask to show/hide

◆ GetMaskTransitionWidth()

proto external float ImageWidget.GetMaskTransitionWidth ( )

Transition width 0.1 and progress 0.2 mean that values in mask lower than progress will be opaque.

Values higher than (progress + width) will be transparent and values between progress and (progress + width) will be smoothly transitioned.

Returns
Width of the alpha mask transition representing softness of the transition.

◆ GetRotation()

proto external float ImageWidget.GetRotation ( )

Returns rotation of widget in degrees.

◆ GetSaturation()

proto external float ImageWidget.GetSaturation ( )

◆ GetShadowColor()

proto ref Color ImageWidget.GetShadowColor ( )

◆ GetShadowOffset()

proto external vector ImageWidget.GetShadowOffset ( )

Returns offset of the image shadow. Z coordinate is not used (always 0)

◆ GetSize()

proto external vector ImageWidget.GetSize ( )

Returns user defined size used in "Size to content" scenarios.

◆ LoadImageFromSet()

proto external bool ImageWidget.LoadImageFromSet ( int  num,
ResourceName  resource,
string  imageName,
bool  noCache = false 
)

Loads image form image set.

When image of this 'num' is already loaded, then is replaced by new one.

Parameters
numNumber of image (0...7)
resourceResourceName of image file
imageNameName of an image in the image set
noCacheDo not cache the texture
Returns
True when image is loaded, false otherwise

◆ LoadImageTexture()

proto bool ImageWidget.LoadImageTexture ( int  num,
ResourceName  resource,
bool  noCache = false,
bool  fromLocalStorage = false 
)

Loads image.

When image of this 'num' is already loaded, then is replaced by new one.

Parameters
numNumber of image (0...7)
resourceResourceName of image file
noCacheDo not cache the texture
fromLocalStoragePrevent checking of ResourceName against Resource Database
Returns
True when image is loaded, false otherwise

◆ LoadMaskFromSet()

proto external bool ImageWidget.LoadMaskFromSet ( ResourceName  resource,
string  imageName 
)

Loads image form image set as mask used for alpha masking.

Parameters
resourceResourceName of image file
imageNameName of an image in the image set
Returns
True when image is loaded, false otherwise

◆ LoadMaskTexture()

proto external bool ImageWidget.LoadMaskTexture ( ResourceName  resource)

Loads texture as mask used for alpha masking.

Parameters
resourceResource name of the texture to load
Returns
True if texture was successfully loaded, false otherwise

◆ SetImage()

proto external bool ImageWidget.SetImage ( int  num)

Switches to another image, if it's loaded.

Parameters
numNumber of image.
Returns
True when there is such image, false otherwise.

◆ SetImageTexture()

proto external void ImageWidget.SetImageTexture ( int  image,
notnull RTTextureWidget  texture 
)

◆ SetMaskMode()

proto external void ImageWidget.SetMaskMode ( ImageMaskMode  maskMode)

◆ SetMaskProgress()

proto external void ImageWidget.SetMaskProgress ( float  value)

See GetMaskProgress for explanation.

Parameters
valueExpected in range [0; 1]

◆ SetMaskRange()

proto external void ImageWidget.SetMaskRange ( float  range)
See also
GetMaskRange

◆ SetMaskTransitionWidth()

proto external void ImageWidget.SetMaskTransitionWidth ( float  value)

See GetMaskTransitionWidth for transition width explanation.

Parameters
valueExpected in range [0; 1]

◆ SetPivot()

proto external void ImageWidget.SetPivot ( float  x,
float  y 
)

Sets pivot around which the widget will rotate.

◆ SetRotation()

proto external void ImageWidget.SetRotation ( float  angle)

Sets rotation of widget around defined center.

Parameters
angleAngle in degrees

◆ SetSaturation()

proto external void ImageWidget.SetSaturation ( float  saturation)

◆ SetShadowColor()

proto external void ImageWidget.SetShadowColor ( notnull Color  color)

◆ SetShadowOffset()

proto external void ImageWidget.SetShadowOffset ( float  x,
float  y 
)

◆ SetSize()

proto external void ImageWidget.SetSize ( float  width,
float  height 
)

Sets user defined size used in "Size to content" scenarios.

◆ SetUV()

proto external void ImageWidget.SetUV ( float  uv[4][2])

When WF_CUSTOMUV is set, we can supply our own UV coords instead of computed ones.

Parameters
uvPointer to array of at least 8 floats (4 corners * 2 floats for u/v)

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