SharedCanvas
SharedCanvas is a service that lets all NetsBlox users view and edit a shared canvas (image). Users can view the canvas, or edit it pixel by pixel. However, there is a cooldown between canvas edits, meaning one user cannot dominate the entire canvas.
SharedCanvas was inspired by Place, which was a social experiment started on Reddit that functioned in much the same way. Place came to capture Reddit’s online culture through the combined efforts of many users striving to control the canvas and display their own images.
RPCS
- SharedCanvas.getCooldown()
Gets the edit cooldown time (in seconds) that is imposed after each edit.
Returns:
BoundedNumber<0>
(BoundedNumber) - Edit cooldown (in seconds).
- SharedCanvas.getCooldownRemaining()
Gets the amount of cooldown time remaining (in seconds) before the next edit can be made on this account. If this is
0
, then the cooldown has expired and you can make your next edit.Returns:
BoundedNumber<0>
(BoundedNumber) - Remaining cooldown time (in seconds), or0
if no cooldown remaining.
- SharedCanvas.getEditCount()
Gets the total number of edits that have been made (successfully) on this account.
Returns:
BoundedInteger<0>
(BoundedInteger) - Total number of edits that have been made on this account.
- SharedCanvas.getHeight()
Gets the current canvas height.
Returns:
BoundedInteger<1>
(BoundedInteger) - The canvas height.
- SharedCanvas.getImage(x: SharedCanvasX?, y: SharedCanvasY?, width: BoundedInteger<1>?, height: BoundedInteger<1>?, scale: BoundedInteger<1>?)
Gets a snapshot of the current canvas as an image. The arguments to this function can be used to retrieve a specific region of the canvas, or they can all be omitted to grab a snapshot of the entire canvas.
Arguments:
x: SharedCanvasX?
(SharedCanvasX) - X position of the top left corner to grab (default0
).y: SharedCanvasY?
(SharedCanvasY) - Y position of the top left corner to grab (default0
).width: BoundedInteger<1>?
(BoundedInteger) - Width of the returned image to grab (default goes all the way to the right).height: BoundedInteger<1>?
(BoundedInteger) - Height of the returned image to grab (default goes all the way to the bottom).scale: BoundedInteger<1>?
(BoundedInteger) - Zoom scale of the returned image (final size cannot be larger than the full canvas) (default1
).
Returns:
Image
(Image) - The requested slice of the current canvas as an image.
- SharedCanvas.getPixel(x: SharedCanvasX, y: SharedCanvasY)
Gets the color of the specified pixel in the image.
Arguments:
x: SharedCanvasX
(SharedCanvasX) - X coordinate of the pixel to read.y: SharedCanvasY
(SharedCanvasY) - Y coordinate of the pixel to read.
Returns:
SharedCanvasColor
(SharedCanvasColor) - The pixel color at the given location.
- SharedCanvas.getSize()
Gets the current canvas size.
Returns:
Tuple<BoundedInteger<1>, BoundedInteger<1>>
(Tuple | BoundedInteger) - The width and height of the canvas, as a list.
- SharedCanvas.getWidth()
Gets the current canvas width.
Returns:
BoundedInteger<1>
(BoundedInteger) - The canvas width.
- SharedCanvas.setPixel(x: SharedCanvasX, y: SharedCanvasY, color: SharedCanvasColor)
Sets the color of the specified pixel in the image.
After making an edit, your account is placed in a cooldown mode where no other edits can be made for a short period. If you are not signed in, you will be counted as a special guest account, which all share the same cooldown timer. Because of this, it is advised to sign in before using this service, esp. if you want to make many edits.
Arguments:
x: SharedCanvasX
(SharedCanvasX) - X coordinate of the pixel to read.y: SharedCanvasY
(SharedCanvasY) - Y coordinate of the pixel to read.color: SharedCanvasColor
(SharedCanvasColor) - The new color to set at the given location.
Returns:
Boolean
(Boolean) -true
if the edit was successful, otherwisefalse
(attempt to edit during cooldown).