Class

RezEvent

RezEvent()

Constructor

# new RezEvent()

Represents a game event response in the Rez game engine. Events are used to communicate the results of user interactions and specify what actions should be taken (scene changes, card plays, flash messages, etc.). Supports method chaining for building complex event responses.

View Source rez_event.js, line 5

Example
// Create an event that plays a card and shows a message
return RezEvent.playCard("next_card").flash("Moving forward!").render();

Methods

# after(callback) → {RezEvent}

Adds a callback to be run after event processing is finished

Parameters:
Name Type Description
callback function

a parameterless callback the runs after processing

View Source rez_event.js, line 414

this event for method chaining

RezEvent

Sets an auto-dismissing banner message to be displayed centred in the viewport

Parameters:
Name Type Attributes Default Description
message string

message to display in the banner

options object <optional>
{}

optional config; supports class (string) and onscreen (ms, default 2000)

View Source rez_event.js, line 198

this event for method chaining

RezEvent

# bannerConfig() → {object|null}

View Source rez_event.js, line 189

the banner config ({message, cssClass, onscreen}), or null

object | null

# cardId() → {string|null}

View Source rez_event.js, line 70

ID of the card to play, or null if no card action

string | null

# constructor()

Creates a new event response with default values

View Source rez_event.js, line 31

# error(message) → {RezEvent}

Sets this event as an error with the specified message

Parameters:
Name Type Description
message string

error message

View Source rez_event.js, line 402

this event for method chaining

RezEvent

# errorMessage() → {string|null}

View Source rez_event.js, line 124

error message if this is an error event, or null

string | null

# flash(message, kind) → {RezEvent}

Adds a flash message to be displayed to the user

Parameters:
Name Type Description
message string

message to display as a flash

kind string

optional notification kind (default: "")

View Source rez_event.js, line 167

this event for method chaining

RezEvent

# flashMessages() → {Array.<string>}

View Source rez_event.js, line 61

array of flash messages to display

Array.<string>

# hasBanner() → {boolean}

View Source rez_event.js, line 180

true if this event has a banner message to display

boolean

# hasFlash() → {boolean}

View Source rez_event.js, line 158

true if this event has flash messages to display

boolean

# hasModal() → {boolean}

View Source rez_event.js, line 215

true if this event has a modal message to display

boolean

# hasModalCard() → {boolean}

View Source rez_event.js, line 247

true if this event has a card to display in a modal

boolean

# isError() → {boolean}

View Source rez_event.js, line 393

true if this is an error event

boolean

Sets a modal message to be displayed to the user

Parameters:
Name Type Attributes Default Description
message string

message to display in the modal body

options object <optional>
{}

optional config; supports title (string)

View Source rez_event.js, line 233

this event for method chaining

RezEvent

# modalCard(cardId, paramsopt) → {RezEvent}

Sets a card to be displayed as a modal dialog

Parameters:
Name Type Attributes Default Description
cardId string

ID of the card to render in the modal

params object <optional>
{}

optional params passed to the card on will_embed

View Source rez_event.js, line 265

this event for method chaining

RezEvent

# modalCardConfig() → {object|null}

View Source rez_event.js, line 256

the modal card config ({cardId, params}), or null

object | null

# modalMessage() → {object|null}

View Source rez_event.js, line 224

the modal message config, or null

object | null

# noop() → {RezEvent}

No-operation method for method chaining when no action is needed

View Source rez_event.js, line 437

this event for method chaining

RezEvent

# params() → {object}

View Source rez_event.js, line 52

the parameters object associated with this event

object

# playCard(cardId) → {RezEvent}

Sets this event to play the specified card

Parameters:
Name Type Description
cardId string

ID of the card to play

View Source rez_event.js, line 288

this event for method chaining

RezEvent

# render() → {RezEvent}

Sets this event to trigger a view render

View Source rez_event.js, line 309

this event for method chaining

RezEvent

# renderEvent() → {boolean}

View Source rez_event.js, line 115

true if this event should trigger a view render

boolean

# runAfter()

Run any after callbacks

View Source rez_event.js, line 426

# sceneChange(sceneId) → {RezEvent}

Sets this event to change to the specified scene

Parameters:
Name Type Description
sceneId string

ID of the scene to change to

View Source rez_event.js, line 329

this event for method chaining

RezEvent

# sceneChangeEvent() → {boolean}

View Source rez_event.js, line 88

true if this event should trigger a scene change

boolean

# sceneId() → {string|null}

View Source rez_event.js, line 79

ID of the scene for scene transition, or null if no scene action

string | null

# sceneInterlude(sceneId) → {RezEvent}

Sets this event to start an interlude with the specified scene

Parameters:
Name Type Description
sceneId string

ID of the scene to interlude with

View Source rez_event.js, line 354

this event for method chaining

RezEvent

# sceneInterludeEvent() → {boolean}

View Source rez_event.js, line 97

true if this event should trigger a scene interlude

boolean

# sceneResume() → {RezEvent}

Sets this event to resume the previous scene from the scene stack

View Source rez_event.js, line 379

this event for method chaining

RezEvent

# sceneResumeEvent() → {boolean}

View Source rez_event.js, line 106

true if this event should resume the previous scene

boolean

# setParam(name, value) → {RezEvent}

Sets a single parameter on this event

Parameters:
Name Type Description
name string

parameter name

value *

parameter value

View Source rez_event.js, line 133

this event for method chaining

RezEvent

# setParams(params) → {RezEvent}

Replaces the entire parameters object for this event

Parameters:
Name Type Description
params object

parameters object to set

View Source rez_event.js, line 146

this event for method chaining

RezEvent

# shouldChangeScene() → {boolean}

View Source rez_event.js, line 320

true if this event should change to a new scene

boolean

# shouldInterludeScene() → {boolean}

View Source rez_event.js, line 345

true if this event should start a scene interlude

boolean

# shouldPlayCard() → {boolean}

View Source rez_event.js, line 279

true if this event should play a card

boolean

# shouldRender() → {boolean}

View Source rez_event.js, line 300

true if this event should trigger a view render

boolean

# shouldResumeScene() → {boolean}

View Source rez_event.js, line 370

true if this event should resume the previous scene

boolean

# static after(callback) → {RezEvent}

Creates a new event that runs the specified callback after being processed

Parameters:
Name Type Description
callback function

a parameterless callback the runs after processing

View Source rez_event.js, line 591

a new event that will run the callback after processing

RezEvent

# static banner(message, optionsopt) → {RezEvent}

Creates a new event that displays an auto-dismissing centred banner

Parameters:
Name Type Attributes Default Description
message string

message to display in the banner

options object <optional>
{}

optional config; supports class (string) and onscreen (ms, default 2000)

View Source rez_event.js, line 470

a new event with the banner message set

RezEvent

# static built_in() → {RezEvent}

Creates a new built-in event with default values

View Source rez_event.js, line 447

a new empty event

RezEvent

# static error(message) → {RezEvent}

Creates a new event that represents an error

Parameters:
Name Type Description
message string

error message

View Source rez_event.js, line 603

a new error event

RezEvent

# static flash(message) → {RezEvent}

Creates a new event that displays a flash message

Parameters:
Name Type Description
message string

flash message to display

View Source rez_event.js, line 458

a new event with the flash message

RezEvent

# static modal(message, optionsopt) → {RezEvent}

Creates a new event that displays a modal dialog

Parameters:
Name Type Attributes Default Description
message string

modal body message

options object <optional>
{}

optional config; supports title (string)

View Source rez_event.js, line 483

a new event with the modal message set

RezEvent

# static modalCard(cardId, paramsopt) → {RezEvent}

Creates a new event that displays a card as a modal dialog

Parameters:
Name Type Attributes Default Description
cardId string

ID of the card to render in the modal

params object <optional>
{}

optional params passed to the card on will_embed

View Source rez_event.js, line 496

a new event with the modal card set

RezEvent

# static noop() → {RezEvent}

Creates a new event that performs no action

View Source rez_event.js, line 580

a new empty event

RezEvent

# static playCard(cardId) → {RezEvent}

Creates a new event that plays the specified card

Parameters:
Name Type Description
cardId string

ID of the card to play

View Source rez_event.js, line 509

a new event that plays the specified card

RezEvent

# static render() → {RezEvent}

Creates a new event that triggers a view render

View Source rez_event.js, line 521

a new event that triggers a render

RezEvent

# static sceneChange(sceneId) → {RezEvent}

Creates a new event that changes to the specified scene

Parameters:
Name Type Description
sceneId string

ID of the scene to change to

View Source rez_event.js, line 545

a new event that changes to the specified scene

RezEvent

# static sceneInterlude(sceneId) → {RezEvent}

Creates a new event that starts an interlude with the specified scene

Parameters:
Name Type Description
sceneId string

ID of the scene to interlude with

View Source rez_event.js, line 557

a new event that starts an interlude

RezEvent

# static sceneResume() → {RezEvent}

Creates a new event that resumes the previous scene from the stack

View Source rez_event.js, line 569

a new event that resumes the previous scene

RezEvent

# static setParam(param, value) → {RezEvent}

Creates a new event with a single parameter set

Parameters:
Name Type Description
param string

parameter name

value *

parameter value

View Source rez_event.js, line 532

a new event with the specified parameter

RezEvent