Game
TicksPerSecond
TicksPerSecond -> number
Returns 60
, the number of ticks per second.
AfterPhysics
await AfterPhysics(interval?)
Sleeps for interval
ticks, then wakes up at the beginning of the next AfterPhysics
phase.
interval
(Number): The number of ticks to sleep.
AfterReap
await AfterReap(interval?)
Sleeps for interval
ticks, then wakes up at the beginning of the next AfterReap
phase.
interval
(Number): The number of ticks to sleep.
AfterTick
await AfterTick(interval?)
Sleeps for interval
ticks, then wakes up at the beginning of the next AfterTick
phase.
interval
(Number): The number of ticks to sleep.
BeforePhysics
await BeforePhysics(interval?)
Sleeps for interval
ticks, then wakes up at the beginning of the next BeforePhysics
phase.
interval
(Number): The number of ticks to sleep.
BeforeReap
await BeforeReap(interval?)
Sleeps for interval
ticks, then wakes up at the beginning of the next BeforeReap
phase.
interval
(Number): The number of ticks to sleep.
BeforeTick
await BeforeTick(interval?)
Sleeps for interval
ticks, then wakes up at the beginning of the next BeforeTick
phase.
interval
(Number): The number of ticks to sleep.
ChatEnabledDropdown
ChatEnabledDropdown(width?=, [ui])
Creates a dropdown in the user interface that allows the current player to change whether or not they can see the chat controls when in-game.
width
(Number): the width of the chat editor inem
units.ui
(UI): the slot in the user interface to insert the dropdown element.
ChatEnabledIntent
ChatEnabledIntent(enabled) -> intent
Returns an intent to change whether chat is enabled or disabled. Attach the intent to a button Button to trigger it.
- enabled (Boolean): Whether to enable or disable chat.
ChatEnabledToggle
ChatEnabledToggle([ui=]) |use ui:whenOn, use ui:whenOff| { }
Creates an element in the user interface that allows the player to toggle the chat panel on or off.
ui
(UI): The slot in the user interface where the element will be inserted.
Subblock: The subblock will be called immediately to populate the element's content.
The subblock is optional as there are defaults for both the on and off states.
Use the %ui:whenOn { ... }
syntax to populate one of the slots,
see UI for more information.
ui:whenOn
(UI): populate this slot with the content that should be displayed when the chat is enabled. If left empty, will display a default button that will toggle the chat to off.ui:whenOff
(UI): populate this slot with the content that should be displayed when the chat is disabled If left empty, will display a default button that will toggle the chat to on.
InPageMode
InPageMode -> boolean
Returns true
if the entrypoint function was a page fn
,
or false
if it was a game fn
.
Paint
await Paint(interval?)
Sleeps for interval
ticks, then wakes up at the beginning of the next Paint
phase.
interval
(Number): The number of ticks to sleep.
PartyIntent
PartyIntent -> intent
Returns an intent to go to the party interface for your game. The party interface allows people to create a private instace of the game and invite friends to play. Intents can be triggered by a button Button press.
PerformanceDialogToggle
PerformanceDialogToggle([ui=]) |use ui:whenShowing, use ui:whenHidden| { }
Creates an element in the user interface that allows the player to toggle the performance dialog on or off. This dialog allows the player to view and modify their input latency settings.
ui
(UI): The slot in the user interface where the element will be inserted.
Subblock: The subblock will be called immediately to populate the element's content.
The subblock is optional and is only needed if you want to override the default toggle button styling.
Use the %ui:whenShowing { ... }
syntax to populate one of the slots,
see UI for more information.
ui:whenShowing
(UI): populate this slot with the content that should be displayed when the performance dialog is showing. If left empty, will display a default button that will toggle the performance dialog to hidden.ui:whenHidden
(UI): populate this slot with the content that should be displayed when the performance dialog is hidden. If left empty, will display a default button that will toggle the performance dialog to showing.
ProjectName
ProjectName -> string
Returns the name of the project, according to its easel.toml
file.
RemixIntent
RemixIntent -> intent
Returns an intent to take the user to the game editor where they can create their own version of this game. Intents can be triggered by a button Button press.
Remixing is an essential part of the Easel culture - it is easier for people to learn to code when they can tinker with a game they already know and love.
Tick
await Tick(interval?)
Sleeps for interval
ticks, then wakes up at the beginning of the next Tick
phase.
interval
(Number): The number of ticks to sleep.
Tick -> number
Returns the current tick number.