Gamalto

Fork me on GitHub

Object Screen Overview

Gamalto. Screen

new Gamalto.Screen(width, height, canvasopt)

Creates a new surface to handle the main display.

Parameters
Name Type Attributes Description
width number

Physical horizontal size of the screen.

height number

Physical vertical size of the screen.

canvas Gamalto.BaseCanvas <optional>

Type of the internal canvas.

Extends
Example
var screen = new Gamalto.Screen(320, 240);

Members

height :number

inherited readonly

Vertical size of the surface.

Inherited From
Implements

renderer :Gamalto.BaseRenderer

inherited readonly

Internal canvas renderer.

Inherited From

STRETCH_DEFAULT :number

constant

No specific streching.

STRETCH_FILL :number

constant

Bit to fill the parent.

STRETCH_UNIFORM :number

constant

Bit to keep aspect ratio.

tag :object

inherited

Utility property to exchange data between objects.

Inherited From

width :number

inherited readonly

Horizontal size of the surface.

Inherited From
Implements

Methods

setActive(screen)

static

Sets the visible screen.

Parameters
Name Type Description
screen Gamalto.Screen

Screen to be shown.

blit(surface, x, y)

inherited

Copies a surface content at the given position.

Parameters
Name Type Description
surface Gamalto.Surface

Surface to copy.

x number

Horizontal origin of the copy.

y number

Vertical origin of the copy.

Inherited From

clear()

override

Clears the screen to black.

Overrides

clone() object

inherited abstract

Clones the object. It will be shallow copy unless otherwise specfied.

Inherited From
Returns
  • New instance of the object. Defaults to null.

disableClipping()

inherited

Disables the renderering clipping.

Inherited From

enableClipping(rect)

inherited

Activates the renderering clipping.

Parameters
Name Type Description
rect Gamalto.Box

Rectangle representing the clipping area.

Inherited From

enableFiltering(isOn)

Sets the filtering state.

Parameters
Name Type Description
isOn boolean

Whether to smooth the screen when stretched.

enableMouse(isOn)

Sets the mouse cursor visibility.

Parameters
Name Type Description
isOn boolean

Whether to show the mouse cursor.

getSurface() Gamalto.Surface

Gets the displayed screen surface for direct access. Accessing the surface may lead to unexpected rendering artifacts.

Returns
  • Screen surface.

lock() object

inherited

Gets a buffer for direct drawing.

Inherited From
Returns
  • A buffer or null if the surface is already locked.

redraw(surface, x, y, regions)

inherited

Redraws parts of the given surface into the current surface.

Parameters
Name Type Description
surface Gamalto.Surface

Surface to copy.

x number

Horizontal origin of the copy.

y number

Vertical origin of the copy.

regions array.<Gamalto.Box>

List of the regions to be updated.

Inherited From

refresh()

Displays the screen content.

setScanlines(dark, light)

Sets the scalines effect state. If no parameter is specified, scalines are disabled.

Parameters
Name Type Description
dark number

The dark lines level between 0 and 1.

light number

The light lines level between 0 and 1.

setStretch(mode)

Adjust the logical screen size.

Parameters
Name Type Description
mode number

Bitmask indicating the transformation to apply.

toString() string

inherited abstract

Converts the object into a string.

Inherited From
Returns
  • string

unlock()

inherited

Unlocks a previously locked surface.

Inherited From
Documentation generated by JSDoc 3.3.2 on Sun Sep 13 2015 20:13:31 GMT+0200 (CEST)