Class Frame
Extends
View.
a overlay view with it's own space and hierarchy, a 'window' in OS talk. Hidden by default !CONSTRUCTOR PARAMETERS ARE PROVIDED IN A OBJECT LITERAL!
Defined in: gamejs-gui.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Frame(parent, constrain, size, position, surface, visible)
|
Field Attributes | Field Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
close()
Close frame.
|
|
destroy()
closes frame, then destroys it
|
|
move(position)
implements restricting frame to GUI bounds.
|
|
paint()
Default implementation, white fill and gray border.
|
|
show()
Show frame, move it to top of the screen
|
- Methods borrowed from class View:
- addChild, blitChild, center, despatchEvent, draw, getGUI, getPosition, getRect, getSize, hide, isFocused, isHovered, isVisible, moveRelative, on, refresh, removeChild, resize, update
Class Detail
Frame(parent, constrain, size, position, surface, visible)
- Parameters:
- {GUI} parent
- parent GUI object
- {Bool} constrain
- if true, frame cannot be moved out of visible area
- {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? OPTIONAL, DEFAULT true
Field Detail
{Bool}
constrain
Method Detail
close()
Close frame. You propably want to use this instead of hide()! generates EVT_CLOSE
destroy()
closes frame, then destroys it
move(position)
implements restricting frame to GUI bounds. generates EVT_MOVE
- Parameters:
- {Array} position
- position to move frame to
paint()
Default implementation, white fill and gray border.
show()
Show frame, move it to top of the screen