API Docs for: 0.0.2
Show:

Atlantis.GraphicsDevice Class

Module: Framework
Parent Module: Atlantis

The graphics device is response to manage screen (canvas) and draws (render target).

Constructor

Atlantis.GraphicsDevice

(
  • width
  • height
  • settings
)

Parameters:

  • width Number

    The desired screen width

  • height Number

    The desired screen height

  • settings Object

    A list of options (webGL, backBufferWidth/Height, canvas).

Methods

applyChanges

()

Apply the values of preferredBackBufferWidth/Height to the screen. The back buffer is moved according to the scale mode. Note that an event of type Atlantis.event.ResolutionChanged is fired at the end of the process.

clear

(
  • color
)

Clear all buffers

Parameters:

  • color String

    The clear color (default black).

getBackBuffer

() Atlantis.RenderTarget

Gets the back buffer renderTarget.

Returns:

Atlantis.RenderTarget:

Return the renderTarget of the back buffer.

getFrontBuffer

() Atlantis.RenderTarget

Gets the front buffer renderTarget.

Returns:

Atlantis.RenderTarget:

Return the renderTarget of the front buffer.

isFullscreen

() Boolean

Indicate if the fullscreen mode is active

Returns:

Boolean:

Return true if the fullscreen mode is active, o

present

()

Draw the back buffer into the front buffer.

toggleFullscreen

(
  • The
)

Toggle the passed element in fullscreen mode if the browser support this feature.

Parameters:

  • The HTMLElement

    node to use (default is the canvas element).