mirror of
https://github.com/TangentFoxy/Pop.Box.git
synced 2024-12-15 12:44:20 +00:00
529 lines
12 KiB
HTML
529 lines
12 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
<head>
|
|
<title>Documentation</title>
|
|
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
|
|
</head>
|
|
<body>
|
|
|
|
<div id="container">
|
|
|
|
<div id="product">
|
|
<div id="product_logo"></div>
|
|
<div id="product_name"><big><b></b></big></div>
|
|
<div id="product_description"></div>
|
|
</div> <!-- id="product" -->
|
|
|
|
|
|
<div id="main">
|
|
|
|
|
|
<!-- Menu -->
|
|
|
|
<div id="navigation">
|
|
<br/>
|
|
<h1>Pop.Box()</h1>
|
|
|
|
<ul>
|
|
<li><a href="../index.html">Index</a></li>
|
|
</ul>
|
|
|
|
<h2>Contents</h2>
|
|
<ul>
|
|
<li><a href="#Functions">Functions</a></li>
|
|
<li><a href="#Tables">Tables</a></li>
|
|
</ul>
|
|
|
|
|
|
<h2>Modules</h2>
|
|
<ul class="$(kind=='Topics' and '' or 'nowrap'">
|
|
<li><strong>pop</strong></li>
|
|
<li><a href="../modules/util.html">util</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Module <code>pop</code></h1>
|
|
<p>The Pop.Box GUI itself.</p>
|
|
<p>
|
|
|
|
</p>
|
|
<h3>Info:</h3>
|
|
<ul>
|
|
<li><strong>Copyright</strong>: Paul Liverman III (2015-2016)</li>
|
|
<li><strong>Release</strong>: 0.0.0</li>
|
|
<li><strong>License</strong>: The MIT License (MIT)</li>
|
|
</ul>
|
|
|
|
|
|
<h2><a href="#Functions">Functions</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#load">load ()</a></td>
|
|
<td class="summary">Loads elements, skins, extensions, and initializes <code>pop.screen</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#create">create (element, parent, ...)</a></td>
|
|
<td class="summary">Creates an element.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#update">update (dt, element)</a></td>
|
|
<td class="summary">Event handler for <code>love.update()</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#draw">draw (element)</a></td>
|
|
<td class="summary">Event handler for <code>love.draw()</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#mousemoved">mousemoved (x, y, dx, dy)</a></td>
|
|
<td class="summary">Event handler for <code>love.mousemoved()</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#mousepressed">mousepressed (x, y, button, element)</a></td>
|
|
<td class="summary">Event handler for <code>love.mousepressed()</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#mousereleased">mousereleased (x, y, button, element)</a></td>
|
|
<td class="summary">Event handler for <code>love.mousereleased()</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#keypressed">keypressed (key)</a></td>
|
|
<td class="summary">Event handler for <code>love.keypressed()</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#keyreleased">keyreleased (key)</a></td>
|
|
<td class="summary">Event handler for <code>love.keyreleased()</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#textinput">textinput (text)</a></td>
|
|
<td class="summary">Event handler for <code>love.textinput()</code>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#skin">skin (element, skin, depth)</a></td>
|
|
<td class="summary">Applies skins to elements.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#debugDraw">debugDraw (element)</a></td>
|
|
<td class="summary">Draws simple rectangle outlines to debug placement of elements.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#printElementTree">printElementTree (element)</a></td>
|
|
<td class="summary">Prints a basic structure of GUI elements with minimal info.</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Tables">Tables</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#pop">pop</a></td>
|
|
<td class="summary">
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "load"></a>
|
|
<strong>load ()</strong>
|
|
</dt>
|
|
<dd>
|
|
Loads elements, skins, extensions, and initializes <code>pop.screen</code>. </p>
|
|
|
|
<p> <strong>IMPORTANT</strong>: Intended to only be called once, and is automatically called when you require Pop.Box.
|
|
|
|
|
|
|
|
|
|
|
|
<h3>See also:</h3>
|
|
<ul>
|
|
<a href="../modules/pop.html#">pop</a>
|
|
</ul>
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "create"></a>
|
|
<strong>create (element, parent, ...)</strong>
|
|
</dt>
|
|
<dd>
|
|
Creates an element.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">element</span>
|
|
A string naming the element class to use.
|
|
</li>
|
|
<li><span class="parameter">parent</span>
|
|
[opt] The parent element. If <code>false</code>, an element is created with no parent. If <code>nil</code>, defaults to <code>pop.screen</code>.
|
|
</li>
|
|
<li><span class="parameter">...</span>
|
|
[opt] Any number of parameters can be passed to the constructor for the element.</p>
|
|
|
|
<p> (<strong>Note</strong>: An element with no parent will not be handled by Pop.Box's event handlers unless you handle it explicitly.)
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
<h3>See also:</h3>
|
|
<ul>
|
|
<a href="../modules/pop.html#">pop</a>
|
|
</ul>
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "update"></a>
|
|
<strong>update (dt, element)</strong>
|
|
</dt>
|
|
<dd>
|
|
Event handler for <code>love.update()</code>.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">dt</span>
|
|
The amount of time passed since the last call to update, in seconds.
|
|
</li>
|
|
<li><span class="parameter">element</span>
|
|
[opt] The element to update (will update all its children as well). Defaults to <code>pop.screen</code>.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "draw"></a>
|
|
<strong>draw (element)</strong>
|
|
</dt>
|
|
<dd>
|
|
Event handler for <code>love.draw()</code>.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">element</span>
|
|
[opt] The element to draw (will draw all its children as well). Defaults to <code>pop.screen</code>.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "mousemoved"></a>
|
|
<strong>mousemoved (x, y, dx, dy)</strong>
|
|
</dt>
|
|
<dd>
|
|
Event handler for <code>love.mousemoved()</code>. (*LÖVE >= 0.10.0*)
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">x</span>
|
|
The x coordinate of the mouse.
|
|
</li>
|
|
<li><span class="parameter">y</span>
|
|
The y coordinate of the mouse.
|
|
</li>
|
|
<li><span class="parameter">dx</span>
|
|
The distance on the x axis the mouse was moved.
|
|
</li>
|
|
<li><span class="parameter">dy</span>
|
|
The distance on the y axis the mouse was moved.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<code>true</code> / <code>false</code>: Was the event handled?
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "mousepressed"></a>
|
|
<strong>mousepressed (x, y, button, element)</strong>
|
|
</dt>
|
|
<dd>
|
|
Event handler for <code>love.mousepressed()</code>.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">x</span>
|
|
The x coordinate of the mouse press.
|
|
</li>
|
|
<li><span class="parameter">y</span>
|
|
The y coordinate of the mouse press.
|
|
</li>
|
|
<li><span class="parameter">button</span>
|
|
The mouse button pressed.
|
|
</li>
|
|
<li><span class="parameter">element</span>
|
|
[opt] The element to check for event handling (will check its children as well). Defaults to <code>pop.screen</code>.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<code>true</code> / <code>false</code>: Was the event handled?
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "mousereleased"></a>
|
|
<strong>mousereleased (x, y, button, element)</strong>
|
|
</dt>
|
|
<dd>
|
|
Event handler for <code>love.mousereleased()</code>.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">x</span>
|
|
The x coordinate of the mouse release.
|
|
</li>
|
|
<li><span class="parameter">y</span>
|
|
The y coordinate of the mouse release.
|
|
</li>
|
|
<li><span class="parameter">button</span>
|
|
The mouse button released.
|
|
</li>
|
|
<li><span class="parameter">element</span>
|
|
[opt] The element to check for event handling (will check its children as well). Defaults to <code>pop.screen</code>.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
<li>
|
|
<code>true</code> / <code>false</code>: Was a click handled?</li>
|
|
<li>
|
|
<code>true</code> / <code>false</code>: Was a mouse release handled?</li>
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "keypressed"></a>
|
|
<strong>keypressed (key)</strong>
|
|
</dt>
|
|
<dd>
|
|
Event handler for <code>love.keypressed()</code>.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">key</span>
|
|
The key that was pressed.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<code>true</code> / <code>false</code>: Was the event handled?
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "keyreleased"></a>
|
|
<strong>keyreleased (key)</strong>
|
|
</dt>
|
|
<dd>
|
|
Event handler for <code>love.keyreleased()</code>.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">key</span>
|
|
The key that was released.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<code>true</code> / <code>false</code>: Was the event handled?
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "textinput"></a>
|
|
<strong>textinput (text)</strong>
|
|
</dt>
|
|
<dd>
|
|
Event handler for <code>love.textinput()</code>.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">text</span>
|
|
The text that was typed.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<code>true</code> / <code>false</code>: Was the text input handled?
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "skin"></a>
|
|
<strong>skin (element, skin, depth)</strong>
|
|
</dt>
|
|
<dd>
|
|
Applies skins to elements. (<strong>NOTE</strong>: This function will be rewritten and change at some point...)
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">element</span>
|
|
The element to skin (will also be applied to children). Defaults to <code>pop.screen</code>.
|
|
</li>
|
|
<li><span class="parameter">skin</span>
|
|
The skin to use, can be a string or an actual skin object, defaults to the default skin included with Pop.Box.
|
|
</li>
|
|
<li><span class="parameter">depth</span>
|
|
[opt] An integer for how many child levels to skin, OR, if <code>true</code>, will skin all children.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "debugDraw"></a>
|
|
<strong>debugDraw (element)</strong>
|
|
</dt>
|
|
<dd>
|
|
Draws simple rectangle outlines to debug placement of elements.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">element</span>
|
|
The element to draw (will draw its children as well). Defaults to <code>pop.screen</code>.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "printElementTree"></a>
|
|
<strong>printElementTree (element)</strong>
|
|
</dt>
|
|
<dd>
|
|
Prints a basic structure of GUI elements with minimal info.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">element</span>
|
|
The element to start at. Defaults to <code>pop.screen</code>.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "pop"></a>
|
|
<strong>pop</strong>
|
|
</dt>
|
|
<dd>
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Fields:</h3>
|
|
<ul>
|
|
<li><span class="parameter">elements</span>
|
|
All GUI classes are stored here.
|
|
</li>
|
|
<li><span class="parameter">skins</span>
|
|
All skins are stored here.
|
|
</li>
|
|
<li><span class="parameter">extensions</span>
|
|
All extensions are loaded here.
|
|
</li>
|
|
<li><span class="parameter">screen</span>
|
|
The top level GUI element. Represents the game screen. Initialized in <code>pop.load()</code>
|
|
</li>
|
|
<li><span class="parameter">focused</span>
|
|
The currently focused GUI element (or <code>false</code> if none is focused).
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
<h3>See also:</h3>
|
|
<ul>
|
|
<a href="../modules/pop.html#load">pop.load</a>
|
|
</ul>
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
</div> <!-- id="content" -->
|
|
</div> <!-- id="main" -->
|
|
<div id="about">
|
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
|
|
<i style="float:right;">Last updated 2016-08-20 21:29:17 </i>
|
|
</div> <!-- id="about" -->
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|