Grape.GUIView Class
A View which creates a simple div as view, which can be used to render real DOM elements.
Constructor
Grape.GUIView
()
Item Index
Events
Methods
createDom
()
HTMLElement
This abstract method should create the HTMLElement which serves
Returns:
Canvas
getHeight
()
Number
Returns the calculated height value.
Returns:
calculated height
getLeft
()
Number
Returns the calculated width left.
Returns:
calculated left
getOriginX
()
Number
Returns the calculated originX value.
Returns:
calculated originX
getOriginY
()
Number
Returns the calculated originY value.
Returns:
calculated originY
getTop
()
Number
Returns the calculated top value.
Returns:
calculated top
getWidth
()
Number
Returns the calculated width value.
Returns:
calculated width
updateSize
()
This method is called in each render frame, and should be update the displayed element's width. The default functionality is setting the style width and height, but for canvas it is different.
Properties
alpha
Number
The global alpha value of the view.
Default: 1
height
String | Number | Function
The height of the view. The maximum value (100%) is the container height.
Default: '100%'
left
String | Number | Function
The left axis of the view in the container. The maximum value (100%) is the container width.
Default: 0
mouse
Number
Information about the mouse relative to the view.
originX
String | Number | Function
The horizontal origin of the view. Tells where should a point with x = view.x appear on the screen. The maximum value (100%) is the width of the view.
Default: 0
originY
String | Number | Function
The vertical origin of the view. Tells where should a point with y = view.y appear on the screen. The maximum value (100%) is the height of the view.
Default: 0
top
String | Number | Function
The top axis of the view in the container. The maximum value (100%) is the container height.
Default: 0
width
String | Number | Function
The width of the view. The maximum value (100%) is the container width.
Default: '100%'
x
Number
The x coordinate of the showed area.
Default: 0
y
Number
The y coordinate of the showed area.
Default: 0
Events
domCreated
This event is fired after the createDom() method is called and the DOM element is appended to the container. The parameter is the element.
mouseMoveView (layer)
Emitted to the containing layer when the mouse position changed according to the position in the previous frame. The parameter is the view.