Skip to content

Commit 9559099

Browse files
committed
Preparing for 1.0 branch
1 parent ce27acd commit 9559099

36 files changed

Lines changed: 3570 additions & 1007 deletions

Docs/Physics Comparison.xlsx

10.4 KB
Binary file not shown.

Phaser/Phaser.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@
186186
<Content Include="net\Net.js">
187187
<DependentUpon>Net.ts</DependentUpon>
188188
</Content>
189+
<TypeScriptCompile Include="physics\ArcadePhysics.ts" />
190+
<TypeScriptCompile Include="physics\AdvancedPhysics.ts" />
191+
<Content Include="physics\AdvancedPhysics.js">
192+
<DependentUpon>AdvancedPhysics.ts</DependentUpon>
193+
</Content>
194+
<Content Include="physics\ArcadePhysics.js">
195+
<DependentUpon>ArcadePhysics.ts</DependentUpon>
196+
</Content>
189197
<Content Include="physics\Body.js">
190198
<DependentUpon>Body.ts</DependentUpon>
191199
</Content>
@@ -270,6 +278,10 @@
270278
<Content Include="system\screens\OrientationScreen.js">
271279
<DependentUpon>OrientationScreen.ts</DependentUpon>
272280
</Content>
281+
<TypeScriptCompile Include="utils\BodyUtils.ts" />
282+
<Content Include="utils\BodyUtils.js">
283+
<DependentUpon>BodyUtils.ts</DependentUpon>
284+
</Content>
273285
<Content Include="utils\CircleUtils.js">
274286
<DependentUpon>CircleUtils.ts</DependentUpon>
275287
</Content>

Phaser/Stage.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ module Phaser {
169169
*/
170170
public scaleMode: number;
171171

172+
/**
173+
* If set to true the game will never pause when the browser or browser tab loses focuses
174+
* @type {boolean}
175+
*/
176+
public disableVisibilityChange: bool = false;
177+
172178
/**
173179
* Stage boot
174180
*/
@@ -230,6 +236,11 @@ module Phaser {
230236
*/
231237
private visibilityChange(event) {
232238

239+
if (this.disableVisibilityChange)
240+
{
241+
return;
242+
}
243+
233244
if (event.type == 'pagehide' || event.type == 'blur' || document['hidden'] == true || document['webkitHidden'] == true)
234245
{
235246
if (this._game.paused == false)

Phaser/components/Texture.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ module Phaser.Components {
160160
*/
161161
public isDynamic: bool = false;
162162

163+
/**
164+
* The crop rectangle allows you to control which part of the sprite texture is rendered without distorting it.
165+
* Set to null to disable, set to a Phaser.Rectangle object to control the region that will be rendered, anything outside the rectangle is ignored.
166+
* @type {Phaser.Rectangle}
167+
*/
168+
public crop: Phaser.Rectangle;
169+
163170
/**
164171
* Updates the texture being used to render the Sprite.
165172
* Called automatically by SpriteUtils.loadTexture and SpriteUtils.loadDynamicTexture.

Phaser/components/sprite/Input.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ module Phaser.Components.Sprite {
393393
if (this.bringToTop)
394394
{
395395
this._parent.bringToTop();
396+
//this._parent.game.world.group.bringToTop(this._parent);
396397
}
397398

398399
}

Phaser/core/Group.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ module Phaser {
151151

152152
/**
153153
* Override this function to handle any deleting or "shutdown" type operations you might need,
154-
* such as removing traditional Flash children like Basic objects.
154+
* such as removing traditional children like Basic objects.
155155
*/
156156
public destroy() {
157157

@@ -417,10 +417,10 @@ module Phaser {
417417
* @param y {number} Y position of the new sprite.
418418
* @param [key] {string} The image key as defined in the Game.Cache to use as the texture for this sprite
419419
* @param [frame] {string|number} If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
420-
* @param [bodyType] {number} The physics body type of the object (defaults to BODY_DYNAMIC)
420+
* @param [bodyType] {number} The physics body type of the object (defaults to BODY_DISABLED)
421421
* @returns {Sprite} The newly created sprite object.
422422
*/
423-
public addNewSprite(x: number, y: number, key?: string = '', frame? = null, bodyType?: number = Phaser.Types.BODY_DYNAMIC): Sprite {
423+
public addNewSprite(x: number, y: number, key?: string = '', frame? = null, bodyType?: number = Phaser.Types.BODY_DISABLED): Sprite {
424424
return <Sprite> this.add(new Sprite(this.game, x, y, key, frame, bodyType));
425425
}
426426

@@ -527,7 +527,7 @@ module Phaser {
527527
*/
528528
public remove(object, splice: bool = false) {
529529

530-
console.log('removing from group');
530+
//console.log('removing from group: ', object.name);
531531

532532
this._i = this.members.indexOf(object);
533533

@@ -546,7 +546,7 @@ module Phaser {
546546
this.members[this._i] = null;
547547
}
548548

549-
console.log('nulled');
549+
//console.log('nulled');
550550

551551
if (object['events'])
552552
{
@@ -728,6 +728,12 @@ module Phaser {
728728
*/
729729
public sortHandler(obj1, obj2): number {
730730

731+
if (!obj1 || !obj2)
732+
{
733+
//console.log('null objects in sort', obj1, obj2);
734+
return 0;
735+
}
736+
731737
if (obj1[this._sortIndex] < obj2[this._sortIndex])
732738
{
733739
return this._sortOrder;

Phaser/gameobjects/Sprite.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ module Phaser {
7171

7272
if (bodyType !== Phaser.Types.BODY_DISABLED)
7373
{
74-
this.body = new Phaser.Physics.Body(this, bodyType, 0, 0, shapeType);
75-
this.game.physics.addBody(this.body);
76-
this.transform.origin.setTo(0.5, 0.5);
74+
//this.body = new Phaser.Physics.Body(this, bodyType, 0, 0, shapeType);
75+
//this.game.physics.addBody(this.body);
76+
//this.transform.origin.setTo(0.5, 0.5);
7777
}
7878

7979
this.worldView = new Rectangle(x, y, this.width, this.height);
@@ -88,6 +88,7 @@ module Phaser {
8888
this.scale = this.transform.scale;
8989
this.alpha = this.texture.alpha;
9090
this.origin = this.transform.origin;
91+
this.crop = this.texture.crop;
9192

9293
}
9394

@@ -255,6 +256,13 @@ module Phaser {
255256
*/
256257
public scale: Phaser.Vec2;
257258

259+
/**
260+
* The crop rectangle allows you to control which part of the sprite texture is rendered without distorting it.
261+
* Set to null to disable, set to a Phaser.Rectangle object to control the region that will be rendered, anything outside the rectangle is ignored.
262+
* @type {Phaser.Rectangle}
263+
*/
264+
public crop: Phaser.Rectangle;
265+
258266
/**
259267
* The origin of the Sprite around which rotation and positioning takes place.
260268
* This is a reference to Sprite.transform.origin

0 commit comments

Comments
 (0)