Window
Anthony Ma edited this page May 26, 2015
·
3 revisions
Clone this wiki locally
Acts as a surface to draw and hold components on.
Class documentation updated for v0.4.0-alpha. #Fields
-
bgColordefault: colors.lightGray - background color of the window -
tlColordefault: colors.gray - color of the title label of the window -
componentsdefault: {} - a table of all components -
titleLabeldefault: {} - holds the label that acts as the title of the window -
zdefault: 0 - z value of the window - doesn't do anything at this point -
xdefault: 1 - x value of the window -
ydefault: 1 - y value of the window -
hdefault: 1 - height of the window -
wdefault: 1 - width of the window -
visibledefault: false - whether the window is visible -
closeddefault: false - whether the window has been queued for removal -
draggabledefault: false - whether the window is draggable -
hasShadowdefault: false - whether the window has a shadow -
shadowColordefault: colors.black - color for the window shadow -
lastClickdefault: {} - used internally for window movement from drag; should not be set by the user
#Functions
-
function draw(self)- draws the window -
function drawComponents(self)- draws all components of the window -
function setTitleLabel(self, newLabel)- sets the label that acts as the title of the window -
function addComponent(self, componentTbl)- adds a component to the window -
function removeComponent(self, componentTbl)- queues a component for removal -
function close(self)- queues a window to be closed -
function click(self, x, y)- called by the library on a click event -
function key(self, keyCode)- called by the library on a key event -
function char(self, char)- called by the library on a char event -
function scroll(self, direction)- called by the library on as scroll event -
function drag(self, x, y)- called by the library on a drag event -
function onView(self)- called byUIManager:setVisibleWindowwhen a previously invisible window has been set to visible -
function update(self)- called by the library on an update cycle