API Docs for: 0.0.2
Show:

Atlantis.RenderTarget Class

Module: Framework
Parent Module: Atlantis

A render target is a graphics surface where we can draw

Constructor

Atlantis.RenderTarget

(
  • width
  • height
  • (optional)
  • (optional)
)

Parameters:

  • width Number

    Desired width.

  • height Number

    Desired height.

  • (optional) Boolean

    is3D Define if the surface is a 3D surface (WebGL)

  • (optional) HTMLCanvas

    A canvas to use with this renderTarget

Methods

getData

() Object

Gets the image data of the canvas.

Returns:

Object:

Return the ImageData of the context.

setData

(
  • imageData
)

Set the image data of the canvas.

Parameters:

  • imageData Object

    Data to put in the canvas.

() CanvasContext

Get the context of the canvas used to draw.

Returns:

CanvasContext:

Return the canvas context.

clear

()

Clear the entire surface

getCanvas

() HTMLCanvas

Gets the canvas used to draw.

Returns:

HTMLCanvas:

Return the canvas used to draw.

getHeight

() Number

Gets the height of the drawing surface.

Returns:

Number:

Return the height of the drawing surface.

getWidth

() Number

Gets the width of the drawing surface.

Returns:

Number:

Return the width of the drawing surface.

saveAsJpg

() String

Save the content of the renderTarget to an image

Returns:

String:

Return a base64 of the image with mime type "image/jpg"

saveAsPng

() String

Save the content of the renderTarget to an image

Returns:

String:

Return a base64 of the image with mime type "image/png"

setSize

(
  • width
  • height
)

Change the size of the drawing surface.

Parameters: