Tilemap.createCollisionObjects will parse Tiled data for objectgroups and convert polyline instances into physics objects you can collide with in the world.

After defining tiles that collide on a Tilemap, you need to call Tilemap.generateCollisionData(layer) to populate the physics world with the data required.
Debug.renderPhysicsBody updated to take camera location and body rotation into account.
Body movement functions put back to velocity :)
Updated to latest dev version of pixi and latest p2.js
Updated docs
This commit is contained in:
photonstorm
2014-02-18 03:01:51 +00:00
parent 375e9e379a
commit 5d5c64d22f
201 changed files with 41296 additions and 47048 deletions
+75 -60
View File
@@ -58,6 +58,10 @@
<a href="Phaser.BitmapData.html">BitmapData</a>
</li>
<li>
<a href="Phaser.BitmapFont.html">BitmapFont</a>
</li>
<li>
<a href="Phaser.BitmapText.html">BitmapText</a>
</li>
@@ -90,10 +94,6 @@
<a href="Phaser.Device.html">Device</a>
</li>
<li>
<a href="Phaser.DOMSprite.html">DOMSprite</a>
</li>
<li>
<a href="Phaser.Easing.html">Easing</a>
</li>
@@ -142,6 +142,10 @@
<a href="Phaser.Easing.Sinusoidal.html">Sinusoidal</a>
</li>
<li>
<a href="Phaser.Ellipse.html">Ellipse</a>
</li>
<li>
<a href="Phaser.Events.html">Events</a>
</li>
@@ -250,10 +254,6 @@
<a href="Phaser.Physics.Arcade.html">Arcade</a>
</li>
<li>
<a href="Phaser.Physics.Arcade.Body.html">Body</a>
</li>
<li>
<a href="Phaser.Plugin.html">Plugin</a>
</li>
@@ -314,6 +314,10 @@
<a href="Phaser.Sprite.html">Sprite</a>
</li>
<li>
<a href="Phaser.SpriteBatch.html">SpriteBatch</a>
</li>
<li>
<a href="Phaser.Stage.html">Stage</a>
</li>
@@ -412,6 +416,10 @@
<a href="global.html#canUseNewCanvasBlendModes">canUseNewCanvasBlendModes</a>
</li>
<li>
<a href="global.html#getBounds">getBounds</a>
</li>
<li>
<a href="global.html#getNextPowerOfTwo">getNextPowerOfTwo</a>
</li>
@@ -483,37 +491,24 @@ Phaser.StageScaleMode = function (game, width, height) {
/**
* @property {number} minWidth - Minimum width the canvas should be scaled to (in pixels).
* @default
*/
this.minWidth = null;
/**
* @property {number} maxWidth - Maximum width the canvas should be scaled to (in pixels).
* If null it will scale to whatever width the browser can handle.
* @default
* @property {number} maxWidth - Maximum width the canvas should be scaled to (in pixels). If null it will scale to whatever width the browser can handle.
*/
this.maxWidth = null;
/**
* @property {number} minHeight - Minimum height the canvas should be scaled to (in pixels).
* @default
*/
this.minHeight = null;
/**
* @property {number} maxHeight - Maximum height the canvas should be scaled to (in pixels).
* If null it will scale to whatever height the browser can handle.
* @default
* @property {number} maxHeight - Maximum height the canvas should be scaled to (in pixels). If null it will scale to whatever height the browser can handle.
*/
this.maxHeight = null;
/**
* @property {number} _startHeight - Stage height when starting the game.
* @default
* @private
*/
this._startHeight = 0;
/**
* @property {boolean} forceLandscape - If the game should be forced to use Landscape mode, this is set to true by Game.Stage
* @default
@@ -548,20 +543,6 @@ Phaser.StageScaleMode = function (game, width, height) {
*/
this.pageAlignVertically = false;
/**
* @property {number} _width - Cached stage width for full screen mode.
* @default
* @private
*/
this._width = 0;
/**
* @property {number} _height - Cached stage height for full screen mode.
* @default
* @private
*/
this._height = 0;
/**
* @property {number} maxIterations - The maximum number of times it will try to resize the canvas to fill the browser.
* @default
@@ -570,7 +551,6 @@ Phaser.StageScaleMode = function (game, width, height) {
/**
* @property {PIXI.Sprite} orientationSprite - The Sprite that is optionally displayed if the browser enters an unsupported orientation.
* @default
*/
this.orientationSprite = null;
@@ -599,6 +579,11 @@ Phaser.StageScaleMode = function (game, width, height) {
*/
this.hasResized = new Phaser.Signal();
/**
* @property {number} orientation - The orientation value of the game (as defined by window.orientation if set). 90 = landscape. 0 = portrait.
*/
this.orientation = 0;
if (window['orientation'])
{
this.orientation = window['orientation'];
@@ -609,10 +594,6 @@ Phaser.StageScaleMode = function (game, width, height) {
{
this.orientation = 90;
}
else
{
this.orientation = 0;
}
}
/**
@@ -634,16 +615,50 @@ Phaser.StageScaleMode = function (game, width, height) {
this.margin = new Phaser.Point(0, 0);
/**
* @property {number} aspectRatio - Aspect ratio.
* @default
* @property {number} aspectRatio - The aspect ratio of the scaled game.
* @readonly
*/
this.aspectRatio = 0;
/**
* @property {number} sourceAspectRatio - The aspect ratio (width / height) of the original game dimensions.
* @readonly
*/
this.sourceAspectRatio = width / height;
/**
* @property {any} event- The native browser events from full screen API changes.
*/
this.event = null;
/**
* @property {number} scaleMode - The current scaleMode.
*/
this.scaleMode = Phaser.StageScaleMode.NO_SCALE;
/*
* @property {number} fullScreenScaleMode - Scale mode to be used in fullScreen
*/
this.fullScreenScaleMode = Phaser.StageScaleMode.NO_SCALE;
/**
* @property {number} _startHeight - Internal cache var. Stage height when starting the game.
* @private
*/
this._startHeight = 0;
/**
* @property {number} _width - Cached stage width for full screen mode.
* @private
*/
this._width = 0;
/**
* @property {number} _height - Cached stage height for full screen mode.
* @private
*/
this._height = 0;
var _this = this;
window.addEventListener('orientationchange', function (event) {
@@ -762,10 +777,10 @@ Phaser.StageScaleMode.prototype = {
if (this.isFullScreen)
{
if (this.game.stage.fullScreenScaleMode === Phaser.StageScaleMode.EXACT_FIT)
if (this.fullScreenScaleMode === Phaser.StageScaleMode.EXACT_FIT)
{
this.game.stage.canvas.style['width'] = '100%';
this.game.stage.canvas.style['height'] = '100%';
this.game.canvas.style['width'] = '100%';
this.game.canvas.style['height'] = '100%';
this.setMaximum();
@@ -775,16 +790,16 @@ Phaser.StageScaleMode.prototype = {
this.scaleFactor.x = this.game.width / this.width;
this.scaleFactor.y = this.game.height / this.height;
}
else if (this.game.stage.fullScreenScaleMode === Phaser.StageScaleMode.SHOW_ALL)
else if (this.fullScreenScaleMode === Phaser.StageScaleMode.SHOW_ALL)
{
this.game.stage.scale.setShowAll();
this.game.stage.scale.refresh();
this.setShowAll();
this.refresh();
}
}
else
{
this.game.stage.canvas.style['width'] = this.game.width + 'px';
this.game.stage.canvas.style['height'] = this.game.height + 'px';
this.game.canvas.style['width'] = this.game.width + 'px';
this.game.canvas.style['height'] = this.game.height + 'px';
this.width = this._width;
this.height = this._height;
@@ -839,7 +854,7 @@ Phaser.StageScaleMode.prototype = {
this.game.world.visible = true;
}
this.game.stage._stage.addChild(this.orientationSprite);
this.game.stage.addChild(this.orientationSprite);
}
},
@@ -909,7 +924,7 @@ Phaser.StageScaleMode.prototype = {
this.enterPortrait.dispatch(this.orientation, false, true);
}
if (this.game.stage.scaleMode !== Phaser.StageScaleMode.NO_SCALE)
if (this.scaleMode !== Phaser.StageScaleMode.NO_SCALE)
{
this.refresh();
}
@@ -943,7 +958,7 @@ Phaser.StageScaleMode.prototype = {
this.enterPortrait.dispatch(this.orientation, false, true);
}
if (this.game.stage.scaleMode !== Phaser.StageScaleMode.NO_SCALE)
if (this.scaleMode !== Phaser.StageScaleMode.NO_SCALE)
{
this.refresh();
}
@@ -1022,22 +1037,22 @@ Phaser.StageScaleMode.prototype = {
}
else if (!this.isFullScreen)
{
if (this.game.stage.scaleMode == Phaser.StageScaleMode.EXACT_FIT)
if (this.scaleMode == Phaser.StageScaleMode.EXACT_FIT)
{
this.setExactFit();
}
else if (this.game.stage.scaleMode == Phaser.StageScaleMode.SHOW_ALL)
else if (this.scaleMode == Phaser.StageScaleMode.SHOW_ALL)
{
this.setShowAll();
}
}
else
{
if (this.game.stage.fullScreenScaleMode == Phaser.StageScaleMode.EXACT_FIT)
if (this.fullScreenScaleMode == Phaser.StageScaleMode.EXACT_FIT)
{
this.setExactFit();
}
else if (this.game.stage.fullScreenScaleMode == Phaser.StageScaleMode.SHOW_ALL)
else if (this.fullScreenScaleMode == Phaser.StageScaleMode.SHOW_ALL)
{
this.setShowAll();
}
@@ -1246,7 +1261,7 @@ Object.defineProperty(Phaser.StageScaleMode.prototype, "isLandscape", {
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0-dev</a>
on Sat Feb 08 2014 07:19:40 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
on Tue Feb 18 2014 03:01:17 GMT-0000 (GMT) using the <a href="https://github.com/terryweiss/docstrap">DocStrap template</a>.
</span>
</footer>
</div>