mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 14:08:28 +00:00
Tidying up
This commit is contained in:
parent
204ec46b2b
commit
4cef0d1d35
5 changed files with 2 additions and 191 deletions
|
@ -1,66 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<ProjectGuid>{FC407544-CFE2-414B-8936-7355D00E881A}</ProjectGuid>
|
|
||||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<OutputPath>bin</OutputPath>
|
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<UseIISExpress>true</UseIISExpress>
|
|
||||||
<IISExpressSSLPort />
|
|
||||||
<IISExpressAnonymousAuthentication />
|
|
||||||
<IISExpressWindowsAuthentication />
|
|
||||||
<IISExpressUseClassicPipelineMode />
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Content Include="app.css" />
|
|
||||||
<Content Include="default.htm" />
|
|
||||||
<Content Include="app.js">
|
|
||||||
<DependentUpon>app.ts</DependentUpon>
|
|
||||||
</Content>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<TypeScriptCompile Include="app.ts" />
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<RootNamespace>Scratch</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
|
||||||
<ProjectExtensions>
|
|
||||||
<VisualStudio>
|
|
||||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
|
||||||
<WebProjectProperties>
|
|
||||||
<UseIIS>True</UseIIS>
|
|
||||||
<AutoAssignPort>True</AutoAssignPort>
|
|
||||||
<DevelopmentServerPort>0</DevelopmentServerPort>
|
|
||||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
|
||||||
<IISUrl>http://localhost:65337/</IISUrl>
|
|
||||||
<NTLMAuthentication>False</NTLMAuthentication>
|
|
||||||
<UseCustomServer>False</UseCustomServer>
|
|
||||||
<CustomServerUrl>
|
|
||||||
</CustomServerUrl>
|
|
||||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
|
||||||
</WebProjectProperties>
|
|
||||||
</FlavorProperties>
|
|
||||||
</VisualStudio>
|
|
||||||
</ProjectExtensions>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
|
||||||
<TypeScriptTarget>ES5</TypeScriptTarget>
|
|
||||||
<TypeScriptIncludeComments>true</TypeScriptIncludeComments>
|
|
||||||
<TypeScriptSourceMap>false</TypeScriptSourceMap>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
|
||||||
<TypeScriptTarget>ES5</TypeScriptTarget>
|
|
||||||
<TypeScriptIncludeComments>false</TypeScriptIncludeComments>
|
|
||||||
<TypeScriptSourceMap>false</TypeScriptSourceMap>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />
|
|
||||||
</Project>
|
|
|
@ -1,8 +0,0 @@
|
||||||
body
|
|
||||||
{
|
|
||||||
font-family: 'Segoe UI', sans-serif
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
|
||||||
font-style: italic
|
|
||||||
}
|
|
|
@ -1,95 +0,0 @@
|
||||||
module Phaser {
|
|
||||||
|
|
||||||
export class Point1 {
|
|
||||||
|
|
||||||
constructor(x: number = 0, y: number = 0) {
|
|
||||||
|
|
||||||
//this.values = (typeof Float32Array !== 'undefined') ? new Float32Array(2) : new Array;
|
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
x: number;
|
|
||||||
y: number;
|
|
||||||
|
|
||||||
public add(dx: number, dy: number): Point1 {
|
|
||||||
|
|
||||||
this.x += dx;
|
|
||||||
this.y += dy;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
export class Point2 {
|
|
||||||
|
|
||||||
constructor(x: number = 0, y: number = 0) {
|
|
||||||
|
|
||||||
this.values = new Float32Array(2);
|
|
||||||
this.values[0] = x;
|
|
||||||
this.values[1] = y;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
get x(): number {
|
|
||||||
return this.values[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
get y(): number {
|
|
||||||
return this.values[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
set x(v: number) {
|
|
||||||
this.values[0] = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
set y(v: number) {
|
|
||||||
this.values[1] = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
values;
|
|
||||||
|
|
||||||
public add(dx: number, dy: number): Point2 {
|
|
||||||
|
|
||||||
this.values[0] += dx;
|
|
||||||
this.values[1] += dy;
|
|
||||||
|
|
||||||
return this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
window.onload = () => {
|
|
||||||
|
|
||||||
var b = document.getElementById('start').onclick = test;
|
|
||||||
var e = document.getElementById('content');
|
|
||||||
|
|
||||||
function test() {
|
|
||||||
|
|
||||||
var started = Date.now();
|
|
||||||
|
|
||||||
var a = new Phaser.Point1(Math.random(), Math.random());
|
|
||||||
|
|
||||||
for (var i = 0; i < 10000000; i++)
|
|
||||||
{
|
|
||||||
var b = new Phaser.Point1(Math.random(), Math.random());
|
|
||||||
a.add(b.x, b.y);
|
|
||||||
}
|
|
||||||
|
|
||||||
var ended = Date.now();
|
|
||||||
var duration = (ended - started) / 1000;
|
|
||||||
|
|
||||||
var s = 'Test started: ' + started + '\n';
|
|
||||||
s = s + 'Test ended: ' + ended + '\n';
|
|
||||||
s = s + 'Duration: ' + duration + '\n';
|
|
||||||
e.textContent = s;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
|
@ -1,20 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
|
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title>Point Test</title>
|
|
||||||
<link rel="stylesheet" href="app.css" type="text/css" />
|
|
||||||
<script src="app.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Point Test</h1>
|
|
||||||
|
|
||||||
<textarea id="content" style="width: 800px; height: 800px"></textarea>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<button id="start">Start</button>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -13800,6 +13800,7 @@ var Phaser;
|
||||||
(function (Phaser) {
|
(function (Phaser) {
|
||||||
var Camera = (function () {
|
var Camera = (function () {
|
||||||
/**
|
/**
|
||||||
|
|
||||||
*Sprite constructor
|
*Sprite constructor
|
||||||
* Instantiates a new camera at the specified location, with the specified size and zoom level.
|
* Instantiates a new camera at the specified location, with the specified size and zoom level.
|
||||||
*
|
*
|
||||||
|
@ -14059,8 +14060,6 @@ var Phaser;
|
||||||
if(this._rotation !== 0 || this._clip || this.scale.x !== 1 || this.scale.y !== 1) {
|
if(this._rotation !== 0 || this._clip || this.scale.x !== 1 || this.scale.y !== 1) {
|
||||||
this._game.stage.context.save();
|
this._game.stage.context.save();
|
||||||
}
|
}
|
||||||
// It may be safer/quicker to just save the context every frame regardless (needs testing on mobile - sucked on Android 2.x)
|
|
||||||
//this._game.stage.context.save();
|
|
||||||
this.fx.preRender(this, this._stageX, this._stageY, this.worldView.width, this.worldView.height);
|
this.fx.preRender(this, this._stageX, this._stageY, this.worldView.width, this.worldView.height);
|
||||||
if(this.alpha !== 1) {
|
if(this.alpha !== 1) {
|
||||||
this._game.stage.context.globalAlpha = this.alpha;
|
this._game.stage.context.globalAlpha = this.alpha;
|
||||||
|
@ -14114,6 +14113,7 @@ var Phaser;
|
||||||
this._game.stage.context.closePath();
|
this._game.stage.context.closePath();
|
||||||
this._game.stage.context.clip();
|
this._game.stage.context.clip();
|
||||||
}
|
}
|
||||||
|
// Render all the Sprites
|
||||||
this._game.world.group.render(this, this._sx, this._sy);
|
this._game.world.group.render(this, this._sx, this._sy);
|
||||||
if(this.showBorder == true) {
|
if(this.showBorder == true) {
|
||||||
this._game.stage.context.strokeStyle = this.borderColor;
|
this._game.stage.context.strokeStyle = this.borderColor;
|
||||||
|
|
Loading…
Add table
Reference in a new issue