Skip to content

Added a basic event system over RPC.#88

Open
dassjosh wants to merge 1 commit intoFacepunch:masterfrom
dassjosh:events
Open

Added a basic event system over RPC.#88
dassjosh wants to merge 1 commit intoFacepunch:masterfrom
dassjosh:events

Conversation

@dassjosh
Copy link

@dassjosh dassjosh commented Feb 7, 2026

Created a basic event system over RPC. The following events can be added to UI Components. These events are optional and are only turned on if specified. It is possible to disable an event after it has been added by passing a falsy value for the event. There is an optional allowChildren field that specifies if the event should be fired on the children of the UI Component or only the UI Component itself.

  • OnPointerUp
    • Called when a mouse button is released, with the name of the component, the mouse button that was pressed, and the position within the UI element from the bottom left corner
  • OnPointerDown
    • Called when a mouse button is pressed down, with the name of the component, the mouse button that was pressed, and the position within the UI element from the bottom left corner
  • OnPointerEnter
    • Called when a mouse is over a component with the name of the component
  • OnPointerExit
    • Called when a mouse is over a component with the name of the component
  • OnPointerClick
    • Called when a mouse button is clicked, with the name of the component, the mouse button that was pressed, and the position within the UI element from the bottom left corner
  • OnDestroy
    • Called when a UI element is destroyed. It's useful to know when a certain element has been destroyed on the client, so we don't have to track every component for every client on the server.

Examples have been provided in the Tests/EventsTest.json file

Added events OnPointerUp, OnPointerDown, OnPointerEnter, OnPointerExit, OnPointerClick, OnDestroy
Added the ability to allow or block events on children from firing on the parent.
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