new Gamalto.Surface(width, height, canvasopt) Creates a new drawing surface. Parameters Name Type Attributes Description width number Physical horizontal size of the surface. height number Physical vertical size of the surface. canvas number <optional> Type of the internal canvas. Implements Gamalto.ISize Extends Gamalto.Object Example var surface = new Gamalto.Surface(320, 240); Members height :number readonly Vertical size of the surface. Implements Gamalto.ISize#height renderer :Gamalto.BaseRenderer readonly Internal canvas renderer. tag :object inherited Utility property to exchange data between objects. Inherited From Gamalto.Object#tag width :number readonly Horizontal size of the surface. Implements Gamalto.ISize#width Methods blit(surface, x, y) 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. clear() Clears the surface content. clone() object inherited abstract Clones the object. It will be shallow copy unless otherwise specfied. Inherited From Gamalto.Object#clone Returns New instance of the object. Defaults to null. disableClipping() Disables the renderering clipping. enableClipping(rect) Activates the renderering clipping. Parameters Name Type Description rect Gamalto.Box Rectangle representing the clipping area. lock() object Gets a buffer for direct drawing. Returns A buffer or null if the surface is already locked. redraw(surface, x, y, regions) 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. toString() string inherited abstract Converts the object into a string. Inherited From Gamalto.Object#toString Returns string unlock() Unlocks a previously locked surface.