Skip to content
Anthony Ma edited this page May 26, 2015 · 3 revisions

Acts as a surface to draw and hold components on.

Class documentation updated for v0.4.0-alpha. #Fields

  • bgColor default: colors.lightGray - background color of the window
  • tlColor default: colors.gray - color of the title label of the window
  • components default: {} - a table of all components
  • titleLabel default: {} - holds the label that acts as the title of the window
  • z default: 0 - z value of the window - doesn't do anything at this point
  • x default: 1 - x value of the window
  • y default: 1 - y value of the window
  • h default: 1 - height of the window
  • w default: 1 - width of the window
  • visible default: false - whether the window is visible
  • closed default: false - whether the window has been queued for removal
  • draggable default: false - whether the window is draggable
  • hasShadow default: false - whether the window has a shadow
  • shadowColor default: colors.black - color for the window shadow
  • lastClick default: {} - 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 by UIManager:setVisibleWindow when a previously invisible window has been set to visible
  • function update(self) - called by the library on an update cycle