Skip to content

Commit 0541e93

Browse files
committed
Updated so it no longer always tries to run in fullscreen unless you tell it to.
1 parent 5f13032 commit 0541e93

7 files changed

Lines changed: 17446 additions & 4 deletions

File tree

Phaser/Phaser.csproj

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<ProjectGuid>{A90BE60F-CAEA-4747-904A-CDB097BA2459}</ProjectGuid>
6+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
7+
<OutputType>Library</OutputType>
8+
<OutputPath>bin</OutputPath>
9+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
10+
<DebugType>full</DebugType>
11+
<DebugSymbols>true</DebugSymbols>
12+
<UseIISExpress>true</UseIISExpress>
13+
<IISExpressSSLPort />
14+
<IISExpressAnonymousAuthentication />
15+
<IISExpressWindowsAuthentication />
16+
<IISExpressUseClassicPipelineMode />
17+
</PropertyGroup>
18+
<PropertyGroup>
19+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
20+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
21+
</PropertyGroup>
22+
<PropertyGroup>
23+
<RootNamespace>Phaser</RootNamespace>
24+
</PropertyGroup>
25+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
26+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
27+
<ProjectExtensions>
28+
<VisualStudio>
29+
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
30+
<WebProjectProperties>
31+
<UseIIS>True</UseIIS>
32+
<AutoAssignPort>True</AutoAssignPort>
33+
<DevelopmentServerPort>0</DevelopmentServerPort>
34+
<DevelopmentServerVPath>/</DevelopmentServerVPath>
35+
<IISUrl>http://localhost:51891/</IISUrl>
36+
<NTLMAuthentication>False</NTLMAuthentication>
37+
<UseCustomServer>False</UseCustomServer>
38+
<CustomServerUrl>
39+
</CustomServerUrl>
40+
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
41+
</WebProjectProperties>
42+
</FlavorProperties>
43+
</VisualStudio>
44+
</ProjectExtensions>
45+
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
46+
<TypeScriptTarget>ES5</TypeScriptTarget>
47+
<TypeScriptIncludeComments>true</TypeScriptIncludeComments>
48+
<TypeScriptSourceMap>false</TypeScriptSourceMap>
49+
<TypeScriptOutFile>phaser.js</TypeScriptOutFile>
50+
</PropertyGroup>
51+
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
52+
<TypeScriptTarget>ES5</TypeScriptTarget>
53+
<TypeScriptIncludeComments>false</TypeScriptIncludeComments>
54+
<TypeScriptSourceMap>true</TypeScriptSourceMap>
55+
<TypeScriptOutFile>phaser.js</TypeScriptOutFile>
56+
</PropertyGroup>
57+
<ItemGroup>
58+
<TypeScriptCompile Include="Animations.ts" />
59+
<TypeScriptCompile Include="Basic.ts" />
60+
<TypeScriptCompile Include="Cache.ts" />
61+
<TypeScriptCompile Include="Cameras.ts" />
62+
<TypeScriptCompile Include="Emitter.ts" />
63+
<TypeScriptCompile Include="Game.ts" />
64+
<TypeScriptCompile Include="GameMath.ts" />
65+
<TypeScriptCompile Include="GameObject.ts" />
66+
<TypeScriptCompile Include="Group.ts" />
67+
<TypeScriptCompile Include="Loader.ts" />
68+
<TypeScriptCompile Include="Particle.ts" />
69+
<TypeScriptCompile Include="geom\Point.ts" />
70+
<TypeScriptCompile Include="geom\Rectangle.ts" />
71+
<TypeScriptCompile Include="Sound.ts" />
72+
<TypeScriptCompile Include="Sprite.ts" />
73+
<TypeScriptCompile Include="Stage.ts" />
74+
<TypeScriptCompile Include="State.ts" />
75+
<TypeScriptCompile Include="system\animation\Animation.ts" />
76+
<TypeScriptCompile Include="system\animation\AnimationLoader.ts" />
77+
<TypeScriptCompile Include="system\animation\Frame.ts" />
78+
<TypeScriptCompile Include="system\animation\FrameData.ts" />
79+
<TypeScriptCompile Include="system\Camera.ts" />
80+
<TypeScriptCompile Include="system\input\Input.ts" />
81+
<TypeScriptCompile Include="system\input\Keyboard.ts" />
82+
<TypeScriptCompile Include="system\input\Mouse.ts" />
83+
<TypeScriptCompile Include="system\LinkedList.ts" />
84+
<TypeScriptCompile Include="system\QuadTree.ts" />
85+
<TypeScriptCompile Include="system\RequestAnimationFrame.ts" />
86+
<TypeScriptCompile Include="system\Tile.ts" />
87+
<TypeScriptCompile Include="system\TilemapBuffer.ts" />
88+
<TypeScriptCompile Include="Tilemap.ts" />
89+
<TypeScriptCompile Include="Time.ts" />
90+
<TypeScriptCompile Include="World.ts" />
91+
</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>
105+
<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />
106+
<PropertyGroup>
107+
<PostBuildEvent>cd $(ProjectDir)
108+
copy $(ProjectDir)phaser.js ..\Tests\</PostBuildEvent>
109+
</PropertyGroup>
110+
</Project>

Phaser/Stage.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class Stage {
2727

2828
this.offset = this.getOffset(this.canvas);
2929
this.bounds = new Rectangle(this.offset.x, this.offset.y, width, height);
30-
30+
this.aspectRatio = width / height;
31+
this.scaleMode = Stage.SCALE_FIXED;
3132
this.fullscreen = new FullScreen(this._game);
3233

3334
//document.addEventListener('visibilitychange', (event) => this.visibilityChange(event), false);
@@ -40,15 +41,21 @@ class Stage {
4041
private _game: Game;
4142
private _bgColor: string;
4243

44+
public static SCALE_FIXED:number = 0;
45+
public static SCALE_PROPORTIONAL:number = 1;
46+
public static SCALE_FULL:number = 2;
47+
4348
public static ORIENTATION_LANDSCAPE:number = 0;
4449
public static ORIENTATION_PORTRAIT:number = 1;
4550

4651
public bounds: Rectangle;
52+
public aspectRatio: number;
4753
public clear: bool = true;
4854
public canvas: HTMLCanvasElement;
4955
public context: CanvasRenderingContext2D;
5056
public offset: Point;
5157
public fullscreen: FullScreen;
58+
public scaleMode: number;
5259

5360
public update() {
5461

0 commit comments

Comments
 (0)