Enoria
  • Home
  • Guide
    • Getting Started
    • Hello world!
    • Widgets
      • Container
      • Column
      • Row
      • Form
      • GridBuilder
      • ListBuilder
      • TextLabel
      • TextButton
      • ImageLabel
      • ImageButton
      • PageLayout
      • ScrollContainer
      • Stack
      • TextBox
      • TextFormField
      • VerticalSpacer
      • HorizontalSpacer
      • Viewport
  • Events
  • State Management
    • Stores
    • Observer
  • Animations
  • Build forms with validation
  • Theming
    • Classes
Powered by GitBook
On this page

Was this helpful?

Events

Lucky you, Enoria manages event connections automatically!

To connect a widget to an event, add it as a property with the event name (after "On") as the key and a function as the value:

e.TextButton("Click me", {
		OnClick = function()
			print("Clicked!")
		end,
})

Event names are the same than in the Roblox API, except for button clicks (OnClick, OnRightClick, OnClickUp, etc.) which are shorter.

Here's another example but with the MouseEnter event:

e.Container({
		OnMouseEnter = function()
			print("Mouse enter!")
		end,
		Child = e.TextLabel("This is text inside GreenContainer")
})

There is no implementation for GetPropertyChangedSignal at the moment.

PreviousViewportNextState Management

Last updated 4 years ago

Was this helpful?