Create and manage rectangles in the Phaser scene. Created with PhaserGame$add_rectangle() method.
Methods
Method new()
Add a rectangle object to the Phaser scene.
Usage
Rectangle$new(
name,
x,
y,
width,
height,
color,
visible,
clickable,
session = getDefaultReactiveDomain()
)Arguments
nameCharacter. Unique name of the rectangle.
xNumeric. X-coordinate in pixels.
yNumeric. Y-coordinate in pixels.
widthNumeric. Rectangle width in pixels.
heightNumeric. Rectangle height in pixels.
colorCharacter. Fill color in Phaser-compatible format.
visibleLogical. Whether rectangle is initially visible.
clickableLogical. Whether rectangle emits click events.
sessionShiny session object.
Method click()
Add a click event listener to the rectangle that triggers an R function when clicked.