Skip to content

Add PulseComponent#95

Open
Mercury-devs wants to merge 1 commit into
Facepunch:masterfrom
Mercury-devs:PulseEffectCoponent
Open

Add PulseComponent#95
Mercury-devs wants to merge 1 commit into
Facepunch:masterfrom
Mercury-devs:PulseEffectCoponent

Conversation

@Mercury-devs
Copy link
Copy Markdown

Summary

Adds a new Pulse UI component for CUI elements.

The component smoothly animates the alpha of a UI element between alphaMin and alphaMax. This is useful for notifications, highlights, unread indicators, and other UI states that need to draw the player's attention.

Example

{
  "type": "Pulse",
  "alphaMin": 0.4,
  "alphaMax": 1.0,
  "duration": 1.2,
  "restoreOnDisable": true,
  "includeChildren": false
}

Options

  • alphaMin - minimum alpha value during the pulse.
  • alphaMax - maximum alpha value during the pulse.
  • duration - duration of one pulse cycle.
  • restoreOnDisable - restores the original alpha values when the component is disabled.
  • includeChildren - applies the pulse effect to child UI graphics as well.

Enable / Disable

The effect can be stopped or restarted through a regular UI update by changing enabled.

Disable pulse:

{
  "type": "Pulse",
  "enabled": false
}

Enable pulse:

{
  "type": "Pulse",
  "enabled": true
}

When disabled, the original alpha values are restored if restoreOnDisable is enabled.

PulseComponent.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant