Skip to content

Commit

Permalink
Update docs and dist
Browse files Browse the repository at this point in the history
  • Loading branch information
jsfehler committed Mar 23, 2018
1 parent 759e3d1 commit b659215
Show file tree
Hide file tree
Showing 33 changed files with 431 additions and 658 deletions.
121 changes: 54 additions & 67 deletions dist/phaser-ui-tools.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var uiWidgets = uiWidgets || {};
var uiWidgets;
uiWidgets = uiWidgets || {};

uiWidgets.utils = {};

Expand All @@ -18,14 +19,16 @@ uiWidgets.utils.operators = {
"+": function (a, b) { return a + b; },
"-": function (a, b) { return a - b; }
};
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* Group with a dedicated background image.
* Children added to the group will always be above the background image.
* @constructor
* @param {Object} game - Current game instance.
* @param {Object} context - The context this object is called in.
* @param {Number} x - The x position of the Frame.
* @param {Number} y - The y position of the Frame.
* @param {string} bg - The background image to use.
*/
uiWidgets.Frame = function (game, x, y, bg) {
Expand All @@ -50,20 +53,32 @@ uiWidgets.Frame = function (game, x, y, bg) {
uiWidgets.Frame.prototype = Object.create(Phaser.Group.prototype);
uiWidgets.Frame.constructor = uiWidgets.Frame;

/** Adds a new object to the Frame.
* @param {Object} node - The sprite to add to the Frame.
/** Adds a new object into the Column, then aligns it under the previous object.
* @param {Object} node - The sprite to add to the Column.
* @param {Number} alignment - The alignment relative to the previous child.
* @param {Number} padding_x - The amount of horizontal space between objects.
* @param {Number} padding_y - The amount of vertical space between objects.
*/
uiWidgets.Frame.prototype.addNode = function (node) {
uiWidgets.Frame.prototype.addNode = function (node, alignment, padding_x, padding_y) {
"use strict";
alignment = alignment || this.alignment;
padding_x = padding_x || 0;
padding_y = padding_y || 0;

this.add(node);
var previousNode = this.children[this.children.length - 2];

if (previousNode !== undefined) {
node.alignTo(previousNode, alignment, padding_x, padding_y);
}

// Reset the positions for the bar's draggable area.
if ("enableBarDrag" in node) {
node.enableBarDrag();
}

};
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};


/** Base object for all Bars. */
Expand Down Expand Up @@ -175,7 +190,8 @@ uiWidgets.DraggableBar.prototype.enableBarDrag = function () {
draggableArea.h)
;
};
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* Bar that adjusts the size of a static sprite based on a value.
Expand Down Expand Up @@ -367,7 +383,8 @@ uiWidgets.QuantityBar.prototype.getBarSize = function () {

return barSize;
};
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};


/** Used by a QuantityBar to hold the bar's values.
Expand Down Expand Up @@ -501,7 +518,8 @@ uiWidgets.ViewportRange.prototype.getCurrentValue = function () {

return currentValue;
};
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* A bar that moves along a track. The bar is resized relative to the size of the track and size of the content to be scrolled.
Expand Down Expand Up @@ -533,7 +551,7 @@ uiWidgets.Scrollbar = function (game, content, draggable, vertical, trackImage,
// The smallest pixel size allowed for the bar.
this.minBarSize = 44;

this.tweenParams = tweenParams || {'duration': 300, 'ease': Phaser.Easing.Quadratic.Out};
this.tweenParams = tweenParams || {"duration": 300, "ease": Phaser.Easing.Quadratic.Out};

// Flag switched on when the track is clicked, switched off after the bar movement is finished.
this.trackClicked = false;
Expand Down Expand Up @@ -880,7 +898,8 @@ uiWidgets.Scrollbar.prototype.moveContent = function () {

this.onMovement.dispatch(this);
};
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* Bar that adjusts a number.
Expand Down Expand Up @@ -1017,9 +1036,9 @@ uiWidgets.ValueBar.prototype.setInitialBarPosition = function () {

// The bar should always be in centered on it's current position.
if (this.vertical) {
this.bar.y = gripPositionOnTrack + this.track.y - (this.bar.height / 2);
this.bar.y = gripPositionOnTrack + this.track.y - (this.bar.height / 2);
} else {
this.bar.x = gripPositionOnTrack + this.track.x - (this.bar.width / 2);
this.bar.x = gripPositionOnTrack + this.track.x - (this.bar.width / 2);
}

};
Expand Down Expand Up @@ -1100,7 +1119,8 @@ uiWidgets.ValueBar.prototype.getGripPositionRatio = function () {

return newGripPositionRatio;
};
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};


/**
Expand Down Expand Up @@ -1153,13 +1173,16 @@ uiWidgets.textButton = function (game, image, label, style, x, y, callback, call

uiWidgets.textButton.prototype = Object.create(Phaser.Button.prototype);
uiWidgets.textButton.constructor = uiWidgets.textButton;
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* Frame that places new child nodes directly under the previous child.
* @constructor
* @param {Object} game - Current game instance.
* @param {Object} context - The context this object is called in.
* @param {Number} x - The x position of the Frame.
* @param {Number} y - The y position of the Frame.
* @param {string} bg - The background image to use.
*/
uiWidgets.Column = function (game, x, y, bg) {
"use strict";
Expand All @@ -1169,35 +1192,17 @@ uiWidgets.Column = function (game, x, y, bg) {
uiWidgets.Column.prototype = Object.create(uiWidgets.Frame.prototype);
uiWidgets.Column.constructor = uiWidgets.Column;

/** Adds a new object into the Column, then aligns it under the previous object.
* @param {Object} node - The sprite to add to the Column.
* @param {Number} alignment - The alignment relative to the previous child.
* @param {Number} padding - The amount of space between objects.
*/
uiWidgets.Column.prototype.addNode = function (node, alignment, padding) {
"use strict";
alignment = alignment || Phaser.BOTTOM_CENTER;
padding = padding || 0;

this.add(node);
var previousNode = this.children[this.children.length - 2];

if (previousNode !== undefined) {
node.alignTo(previousNode, alignment, 0, padding);
}

// Reset the positions for the bar's draggable area.
if ("enableBarDrag" in node) {
node.enableBarDrag();
}
};
;var uiWidgets = uiWidgets || {};
uiWidgets.Column.prototype.alignment = Phaser.BOTTOM_CENTER;
;var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* Frame that places new child nodes directly next to the previous child.
* @constructor
* @param {Object} game - Current game instance.
* @param {Object} context - The context this object is called in.
* @param {Number} x - The x position of the Frame.
* @param {Number} y - The y position of the Frame.
* @param {string} bg - The background image to use.
*/
uiWidgets.Row = function (game, x, y, bg) {
"use strict";
Expand All @@ -1207,29 +1212,9 @@ uiWidgets.Row = function (game, x, y, bg) {
uiWidgets.Row.prototype = Object.create(uiWidgets.Frame.prototype);
uiWidgets.Row.constructor = uiWidgets.Row;

/** Adds a new object into the Row, then aligns it next to the previous object.
* @param {Object} node - The sprite to add to the row.
* @param {Number} alignment - The alignment relative to the previous child.
* @param {Number} padding - The amount of space between objects.
*/
uiWidgets.Row.prototype.addNode = function (node, alignment, padding) {
"use strict";
alignment = alignment || Phaser.RIGHT_CENTER;
padding = padding || 0;

this.add(node);
var previousNode = this.children[this.children.length - 2];

if (previousNode !== undefined) {
node.alignTo(previousNode, alignment, padding);
}

// Reset the positions for the bar's draggable area.
if ("enableBarDrag" in node) {
node.enableBarDrag();
}
};
;var uiWidgets = uiWidgets || {};
uiWidgets.Row.prototype.alignment = Phaser.RIGHT_CENTER;
;var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* A container with a limited viewable area. Uses a mask to hide children outside of the specified x/y/width/height area.
Expand Down Expand Up @@ -1310,7 +1295,8 @@ uiWidgets.Viewport.prototype.disableOutOfBounds = function (children, context, v
}
}
};
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};

/** Collection of sprites that can be selected with the keyboard.
* When the select key is hit, the sprite that was selected is now connected to the keyboard.
Expand Down Expand Up @@ -1429,7 +1415,8 @@ uiWidgets.KeyboardGroup.prototype.useBar = function () {
this.downKey.onDown.add(this.selected.downEvent, this.selected);
}
};
;var uiWidgets = uiWidgets || {};
;var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* Represents a single point in a Wheel3D.
Expand Down
4 changes: 2 additions & 2 deletions dist/phaser-ui-tools.min.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions docs/bars_bar.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ <h1 class="page-title">Source: bars/bar.js</h1>
<section>
<article>
<pre
class="sunlight-highlight-javascript linenums">var uiWidgets = uiWidgets || {};
class="sunlight-highlight-javascript linenums">var uiWidgets;
uiWidgets = uiWidgets || {};


/** Base object for all Bars. */
Expand Down Expand Up @@ -225,9 +226,9 @@ <h4 class="modal-title">Search results</h4>
</span>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on Sat Feb 17th 2018
on Fri Mar 23rd 2018

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
7 changes: 4 additions & 3 deletions docs/bars_quantitybar.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ <h1 class="page-title">Source: bars/quantitybar.js</h1>
<section>
<article>
<pre
class="sunlight-highlight-javascript linenums">var uiWidgets = uiWidgets || {};
class="sunlight-highlight-javascript linenums">var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* Bar that adjusts the size of a static sprite based on a value.
Expand Down Expand Up @@ -305,9 +306,9 @@ <h4 class="modal-title">Search results</h4>
</span>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on Sat Feb 17th 2018
on Fri Mar 23rd 2018

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
7 changes: 4 additions & 3 deletions docs/bars_ranges.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ <h1 class="page-title">Source: bars/ranges.js</h1>
<section>
<article>
<pre
class="sunlight-highlight-javascript linenums">var uiWidgets = uiWidgets || {};
class="sunlight-highlight-javascript linenums">var uiWidgets;
uiWidgets = uiWidgets || {};


/** Used by a QuantityBar to hold the bar's values.
Expand Down Expand Up @@ -247,9 +248,9 @@ <h4 class="modal-title">Search results</h4>
</span>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on Sat Feb 17th 2018
on Fri Mar 23rd 2018

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
9 changes: 5 additions & 4 deletions docs/bars_scrollbar.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ <h1 class="page-title">Source: bars/scrollbar.js</h1>
<section>
<article>
<pre
class="sunlight-highlight-javascript linenums">var uiWidgets = uiWidgets || {};
class="sunlight-highlight-javascript linenums">var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* A bar that moves along a track. The bar is resized relative to the size of the track and size of the content to be scrolled.
Expand Down Expand Up @@ -102,7 +103,7 @@ <h1 class="page-title">Source: bars/scrollbar.js</h1>
// The smallest pixel size allowed for the bar.
this.minBarSize = 44;

this.tweenParams = tweenParams || {'duration': 300, 'ease': Phaser.Easing.Quadratic.Out};
this.tweenParams = tweenParams || {"duration": 300, "ease": Phaser.Easing.Quadratic.Out};

// Flag switched on when the track is clicked, switched off after the bar movement is finished.
this.trackClicked = false;
Expand Down Expand Up @@ -492,9 +493,9 @@ <h4 class="modal-title">Search results</h4>
</span>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on Sat Feb 17th 2018
on Fri Mar 23rd 2018

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
11 changes: 6 additions & 5 deletions docs/bars_valuebar.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ <h1 class="page-title">Source: bars/valuebar.js</h1>
<section>
<article>
<pre
class="sunlight-highlight-javascript linenums">var uiWidgets = uiWidgets || {};
class="sunlight-highlight-javascript linenums">var uiWidgets;
uiWidgets = uiWidgets || {};

/**
* Bar that adjusts a number.
Expand Down Expand Up @@ -207,9 +208,9 @@ <h1 class="page-title">Source: bars/valuebar.js</h1>

// The bar should always be in centered on it's current position.
if (this.vertical) {
this.bar.y = gripPositionOnTrack + this.track.y - (this.bar.height / 2);
this.bar.y = gripPositionOnTrack + this.track.y - (this.bar.height / 2);
} else {
this.bar.x = gripPositionOnTrack + this.track.x - (this.bar.width / 2);
this.bar.x = gripPositionOnTrack + this.track.x - (this.bar.width / 2);
}

};
Expand Down Expand Up @@ -333,9 +334,9 @@ <h4 class="modal-title">Search results</h4>
</span>

<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on Sat Feb 17th 2018
on Fri Mar 23rd 2018

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Loading

0 comments on commit b659215

Please sign in to comment.