Module pop

The Pop.Box GUI itself.

Info:

  • Copyright: Paul Liverman III (2015-2016)
  • Release: v0.0.0
  • License: The MIT License (MIT)

Functions

load () Loads elements, skins, extensions, and initializes pop.screen.
create (element, parent) Creates an element.
update (dt, element) Event handler for love.update() events.
draw (element) Event handler for love.draw() events.
mousemoved (x, y, dx, dy) Event handler for love.mousemoved() events.

Tables

pop

Issues

pop-todo1 Find out what happens if someone requires the init.lua / init.moon file instead of the directory, add an error message for this.
load-todo2 Determine if extensions should have a reference saved (and the possibility of a load function?) require into pop.extensions by filename
mousemoved-todo3 Implement a way for an element to attach itself to love.mousemoved() events?


Functions

load ()
Loads elements, skins, extensions, and initializes pop.screen. IMPORTANT: Intended to only be called once, and is automatically called when you require Pop.Box.

See also:

create (element, parent)
Creates an element.

Parameters:

  • element A string naming the element class to use.
  • parent Optional The parent element. If false, an element is created with no parent. If nil, defaults to pop.screen. (Note: An element with no parent will not be handled by Pop.Box's event handlers unless you handle it explicitly.)

See also:

update (dt, element)
Event handler for love.update() events.

Parameters:

  • dt The amount of time passed since the last call to update, in seconds.
  • element Optional The element to update. Defaults to pop.screen (and loops through all its children).
draw (element)
Event handler for love.draw() events.

Parameters:

  • element Optional The element to draw. Defaults to pop.screen (and loops through all its children).
mousemoved (x, y, dx, dy)
Event handler for love.mousemoved() events. (*LÖVE >= 0.10.0*)

Parameters:

  • x The x coordinate of the mouse.
  • y The y coordinate of the mouse.
  • dx The distance on the x axis the mouse was moved.
  • dy The distance on the y axis the mouse was moved.

Tables

pop

Fields:

  • elements All GUI classes are stored here.
  • skins All skins are stored here.
  • screen The top level GUI element. Represents the game screen. Initialized in pop.load()
  • focused The currently focused GUI element (or false if none is focused).

See also:

Issues

pop-todo1
Find out what happens if someone requires the init.lua / init.moon file instead of the directory, add an error message for this.
load-todo2
Determine if extensions should have a reference saved (and the possibility of a load function?) require into pop.extensions by filename
mousemoved-todo3
Implement a way for an element to attach itself to love.mousemoved() events?
generated by LDoc 1.4.3 Last updated 2016-06-20 22:28:27