ULimenMenuButton
Overview
ULimenMenuButton is a subclass of ULimenStandardButton and implements the FTickableGameObject interface. It provides a customizable menu button with optional icon support, hover and click effects, and sound playback. The widget rebuilds its Slate representation dynamically based on properties set in the editor.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| bUseIcon | EditAnywhere, BlueprintReadOnly | Determines whether to use an icon on the button. |
| IconBrush | EditAnywhere, BlueprintReadOnly | The brush used for the icon when |
| IconMargin | EditAnywhere, BlueprintReadOnly | Margin around the icon. |
| TextureParameter | EditAnywhere, BlueprintReadOnly | Parameter name for texture effects in the material. |
| ToggleParameter | EditAnywhere, BlueprintReadOnly | Parameter name for toggle effects in the material. |
| EffectMaterial | EditAnywhere, BlueprintReadOnly | Material to apply effects on hover and click. |
| EffectDurationSeconds | EditAnywhere, BlueprintReadOnly | Duration of the distortion effect. |
| HoverSound | EditAnywhere, BlueprintReadOnly | Sound played when the button is hovered over. |
| UnhoverSound | EditAnywhere, BlueprintReadOnly | Sound played when the mouse leaves the button. |
| ClickSound | EditAnywhere, BlueprintReadOnly | Sound played when the button is clicked. |
Functions
Return Type | Signature | Description |
|---|---|---|
| PostInitProperties() | Called after properties are initialized. Sets tickable type if not a class default object. |
| ReleaseSlateResources(bool bReleaseChildren) | Releases Slate resources, including icon and text block references. |
| Tick(float DeltaTime) | Ticks the button to update hover effect elapsed time. |
| GetTickableTickType() const | Returns the tick type for this object. |
| IsTickable() const | Determines if the object is tickable. |
| GetStatId() const | Returns a unique identifier for performance statistics. |
| IsTickableWhenPaused() const | Determines if the object should be ticked when paused. |
| IsTickableInEditor() const | Determines if the object should be ticked in the editor. |
| GetTickableGameObjectWorld() const | Returns the world associated with this tickable object. |
| RebuildWidget() override | Rebuilds the Slate widget based on current properties. |
| OnClicked() override | Handles the button click event, playing distortion effect and sound. |
| OnHovered() override | Handles the mouse hover event, showing icon and playing hover sound. |
| OnUnhovered() override | Handles the mouse unhover event, hiding icon and playing unhover sound. |
| GetIcon() const | Returns a reference to the icon widget. |
| PlayDistortionEffect() | Plays the distortion effect on hover or click. |
| StopDistortionEffect() | Stops the distortion effect and resets elapsed time. |
Usage & Implementation Notes
The button is tickable when not in design mode.
The distortion effect is played on hover and click, with a duration controlled by
EffectDurationSeconds.Sound effects are played during hover and click events using
UGameplayStatics::PlaySound2D.