Skip to content

Commit ebf8360

Browse files
committed
Version 0.7 release. StageScaleMode support added and world input values exposed.
1 parent 0541e93 commit ebf8360

18 files changed

Lines changed: 9289 additions & 271 deletions

Phaser/Game.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/**
1818
* Phaser
1919
*
20-
* v0.6 - April 13th 2013
20+
* v0.7 - April 14th 2013
2121
*
2222
* A small and feature-packed 2D canvas game framework born from the firey pits of Flixel and Kiwi.
2323
*
@@ -50,7 +50,7 @@ class Game {
5050

5151
}
5252

53-
public static VERSION: string = 'Phaser version 0.6';
53+
public static VERSION: string = 'Phaser version 0.7';
5454

5555
private _raf: RequestAnimationFrame;
5656
private _maxAccumulation: number = 32;

Phaser/Phaser.csproj

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
44
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -66,42 +66,37 @@
6666
<TypeScriptCompile Include="Group.ts" />
6767
<TypeScriptCompile Include="Loader.ts" />
6868
<TypeScriptCompile Include="Particle.ts" />
69+
<TypeScriptCompile Include="geom\Circle.ts" />
6970
<TypeScriptCompile Include="geom\Point.ts" />
7071
<TypeScriptCompile Include="geom\Rectangle.ts" />
7172
<TypeScriptCompile Include="Sound.ts" />
7273
<TypeScriptCompile Include="Sprite.ts" />
7374
<TypeScriptCompile Include="Stage.ts" />
7475
<TypeScriptCompile Include="State.ts" />
76+
<TypeScriptCompile Include="Signal.ts" />
77+
<TypeScriptCompile Include="SignalBinding.ts" />
7578
<TypeScriptCompile Include="system\animation\Animation.ts" />
7679
<TypeScriptCompile Include="system\animation\AnimationLoader.ts" />
7780
<TypeScriptCompile Include="system\animation\Frame.ts" />
7881
<TypeScriptCompile Include="system\animation\FrameData.ts" />
7982
<TypeScriptCompile Include="system\Camera.ts" />
83+
<TypeScriptCompile Include="system\Device.ts" />
84+
<TypeScriptCompile Include="system\input\Finger.ts" />
8085
<TypeScriptCompile Include="system\input\Input.ts" />
8186
<TypeScriptCompile Include="system\input\Keyboard.ts" />
8287
<TypeScriptCompile Include="system\input\Mouse.ts" />
88+
<TypeScriptCompile Include="system\input\Touch.ts" />
8389
<TypeScriptCompile Include="system\LinkedList.ts" />
8490
<TypeScriptCompile Include="system\QuadTree.ts" />
91+
<TypeScriptCompile Include="system\RandomDataGenerator.ts" />
8592
<TypeScriptCompile Include="system\RequestAnimationFrame.ts" />
93+
<TypeScriptCompile Include="system\StageScaleMode.ts" />
8694
<TypeScriptCompile Include="system\Tile.ts" />
8795
<TypeScriptCompile Include="system\TilemapBuffer.ts" />
8896
<TypeScriptCompile Include="Tilemap.ts" />
8997
<TypeScriptCompile Include="Time.ts" />
9098
<TypeScriptCompile Include="World.ts" />
9199
</ItemGroup>
92-
<ItemGroup>
93-
<Content Include="geom\Circle.ts" />
94-
<Content Include="Signal.ts" />
95-
<Content Include="SignalBinding.ts" />
96-
<Content Include="system\Device.ts" />
97-
<Content Include="system\FullScreen.js">
98-
<DependentUpon>FullScreen.ts</DependentUpon>
99-
</Content>
100-
<TypeScriptCompile Include="system\FullScreen.ts" />
101-
<Content Include="system\input\Finger.ts" />
102-
<Content Include="system\input\Touch.ts" />
103-
<Content Include="system\RandomDataGenerator.ts" />
104-
</ItemGroup>
105100
<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />
106101
<PropertyGroup>
107102
<PostBuildEvent>cd $(ProjectDir)

Phaser/Stage.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="Game.ts" />
22
/// <reference path="geom/Point.ts" />
33
/// <reference path="geom/Rectangle.ts" />
4-
/// <reference path="system/Fullscreen.ts" />
4+
/// <reference path="system/StageScaleMode.ts" />
55

66
class Stage {
77

@@ -28,8 +28,8 @@ class Stage {
2828
this.offset = this.getOffset(this.canvas);
2929
this.bounds = new Rectangle(this.offset.x, this.offset.y, width, height);
3030
this.aspectRatio = width / height;
31-
this.scaleMode = Stage.SCALE_FIXED;
32-
this.fullscreen = new FullScreen(this._game);
31+
this.scaleMode = StageScaleMode.NO_SCALE;
32+
this.scale = new StageScaleMode(this._game);
3333

3434
//document.addEventListener('visibilitychange', (event) => this.visibilityChange(event), false);
3535
//document.addEventListener('webkitvisibilitychange', (event) => this.visibilityChange(event), false);
@@ -41,9 +41,6 @@ class Stage {
4141
private _game: Game;
4242
private _bgColor: string;
4343

44-
public static SCALE_FIXED:number = 0;
45-
public static SCALE_PROPORTIONAL:number = 1;
46-
public static SCALE_FULL:number = 2;
4744

4845
public static ORIENTATION_LANDSCAPE:number = 0;
4946
public static ORIENTATION_PORTRAIT:number = 1;
@@ -54,12 +51,17 @@ class Stage {
5451
public canvas: HTMLCanvasElement;
5552
public context: CanvasRenderingContext2D;
5653
public offset: Point;
57-
public fullscreen: FullScreen;
54+
public scale: StageScaleMode;
5855
public scaleMode: number;
59-
56+
57+
public minScaleX: number = null;
58+
public maxScaleX: number = null;
59+
public minScaleY: number = null;
60+
public maxScaleY: number = null;
61+
6062
public update() {
6163

62-
this.fullscreen.update();
64+
this.scale.update();
6365

6466
if (this.clear)
6567
{

Phaser/World.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,16 @@ class World {
6161

6262
// World methods
6363

64-
public setSize(width: number, height: number) {
64+
public setSize(width: number, height: number, updateCameraBounds: bool = true) {
6565

6666
this.bounds.width = width;
6767
this.bounds.height = height;
6868

69+
if (updateCameraBounds == true)
70+
{
71+
this._game.camera.setBounds(0, 0, width, height);
72+
}
73+
6974
}
7075

7176
public get width(): number {

0 commit comments

Comments
 (0)