Class DraggableView
Extends
View.
draggable view: can be dragged within its parent by holding down left mouse btn
Defined in: gamejs-gui.js.
Constructor Attributes | Constructor Name and Description |
---|---|
DraggableView(min_x, max_x, min_y, max_y, parent, size, position, surface, visible)
|
Field Attributes | Field Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
move(pos)
implements restricting to coordinates, if applicable
|
- Methods borrowed from class View:
- addChild, blitChild, center, despatchEvent, destroy, draw, getGUI, getPosition, getRect, getSize, hide, isFocused, isHovered, isVisible, moveRelative, on, paint, refresh, removeChild, resize, show, update
Class Detail
DraggableView(min_x, max_x, min_y, max_y, parent, size, position, surface, visible)
- Parameters:
- {Number} min_x
- minimum x coordinate view can be dragged to, OPTIONAL
- {Number} max_x
- maximum x coordinate view can be dragged to, OPTIONAL
- {Number} min_y
- minimum y coordinate view can be dragged to, OPTIONAL
- {Number} max_y
- maximum y coordinate view can be dragged to, OPTIONAL
- {View} parent
- parent element
- {Array} size
- array containing width & height of the element, eg. [width, height]
- {Array} position
- position of the view relative to parent, eg. [x, y]. OPTIONAL, default [0, 0]
- {gamejs.Surface} surface
- surface to render this view on, OPTIONAL
- {Bool} visible
- is this view visible? default true
Field Detail
{Number}
max_x
{Number}
max_y
{Number}
min_x
{Number}
min_y
Method Detail
move(pos)
implements restricting to coordinates, if applicable
- Parameters:
- {Array} pos
- new position