Skip to content

Latest commit

 

History

History
68 lines (55 loc) · 1.84 KB

UICanvas.md

File metadata and controls

68 lines (55 loc) · 1.84 KB

UICanvas

Kind: global class
Npmpackage:

new UICanvas(id, target, css)

This is a display object class, extending UIComponent. Unlike other UI elements, this creates a DOM <canvas>. By extending UIComponent this has all of its native properties and methods. See UIComponent for more info.
Import from ad-ui

Param Type
id string
target element
css object

Example

import { UICanvas } from 'ad-ui'
var myCanvas = new UICanvas({
	id : 'my-btn',
	target : View.main,
	css : {
		x : 15,
		y : 18,
		width : 50,
		height : 20,
		backgroundColor : '#ff0000'
	}
})

UICanvas.context2d : canvas

Getter : Returns direct access to the canvas context of '2d'.

Kind: static property of UICanvas
Example

console.log(myCanvas.context2d)

UICanvas.context3d : canvas

Getter : Returns direct access to the canvas context of 'webgl'.

Kind: static property of UICanvas
Example

console.log(myCanvas.context3d)

UICanvas.toString() ⇒ string

A String representing the object type.

Kind: static method of UICanvas
Returns: string - [object UICanvas]