Class Index | File Index

Classes


Class UIElement


Defined in: ui.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
UIElement(id, img, x, y, width, height)
Creates an instance of a UIElement.
Field Summary
Field Attributes Field Name and Description
 
UIElement height.
 
id
UIElement id.
 
UIElement image object.
 
UIElement width.
 
x
UIElement x position.
 
y
UIElement y position.
Method Summary
Method Attributes Method Name and Description
 
draw(ctx)
Draw the UI element.
 
Check if a certain element has focus by checking it's X, Y, Width and Height.
 
load(image, x, y, width, height)
Load image UI element.
Class Detail
UIElement(id, img, x, y, width, height)
Creates an instance of a UIElement.
Parameters:
{String} id
String ID for UIElement.
{Image} img
Image of UIElement.
{Number} x
x axis position to draw UIElement.
{Number} y
y axis position to draw UIElement.
{Number} width
Width of UIElement.
{Number} height
Height of UIElement.
See:
ui.js
Field Detail
{Number} height
UIElement height.

{String} id
UIElement id.

{[Object Image]} image
UIElement image object.

{Number} width
UIElement width.

{Number} x
UIElement x position.

{Number} y
UIElement y position.
Method Detail
draw(ctx)
Draw the UI element.
Parameters:
{[object CanvasRenderingContext2D]} ctx
2D Canvas context.

{String} elementFocus(x, y)
Check if a certain element has focus by checking it's X, Y, Width and Height.
Parameters:
{Number} x
x axis position to check.
{Number} y
y axis position to check.
Returns:
{String} String denoting ID of UIElement.

load(image, x, y, width, height)
Load image UI element.
Parameters:
{Image} image
UI element image.
{Number} x
x axis coordinate to draw UI element.
{Number} y
y axis coordinate to draw UI element.
{Number} width
Width to draw UI element.
{Number} height
Height to draw UI element.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri May 06 2011 14:41:27 GMT+0100 (BST)