Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #299 from linshun/iss1234_AlphaVersion

Iss1234 alpha version
  • Loading branch information...
commit 4ff0c5cf963f13b0261b69e4f9363359a41835b9 2 parents 67ccf15 + afc96da
@linshun linshun authored
View
20 CHANGELOG.txt
@@ -1,22 +1,22 @@
-cocos2d-html5-v0.5.0-alpha-1 @ May.16, 2012
-
+cocos2d-html5-v0.5.0-alpha @ May.28, 2012
+
* supports canvas and Dom Menu.
-
+
* part of test cases were added and tested in chrome.
-
+
* porting from cocos2d-x is not finished.
-
-* files must load from http server.
-
+
+* files must load from http server.
-cocos2d-html5-v0.1.0 @ Jan.29, 2012
+
+cocos2d-html5-v0.1.0 @ Jan.29, 2012
* Build the directory structure of Engine
-
+
* cocos2d-html5 first version
-
+
* more details: http://www.cocos2d-x.org/
View
2  Demo/HelloWorldTutorial/build.xml
@@ -6,7 +6,7 @@
<target name="compile">
<jscomp compilationLevel="simple" warning="quiet"
- debug="false" output="cocos2d-html5-alpha.js">
+ debug="false" output="cocos2d-html5-alpha-min.js">
<sources dir="${basedir}/../../cocos2d">
<file name="platform/CCClass.js"/>
<file name="platform/CCCommon.js"/>
View
3  Demo/demo.html
@@ -1,5 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML>
<html>
<head>
<title>Cocos2d-HTML5 - other demos</title>
View
2  HelloWorld/build.xml
@@ -6,7 +6,7 @@
<target name="compile">
<jscomp compilationLevel="simple" warning="quiet"
- debug="false" output="cocos2d-html5-alpha.js">
+ debug="false" output="cocos2d-html5-alpha-min.js">
<sources dir="${basedir}/../cocos2d">
<file name="platform/CCClass.js"/>
<file name="platform/CCCommon.js"/>
View
1  README.mdown
@@ -14,7 +14,6 @@ Cross Platform
Documentation
------------------
* Website: [www.cocos2d-x.org][3]
- * [Online API References][4]
Contact us
------------------
View
4 cocos2d/build.xml
@@ -6,7 +6,7 @@
<target name="compile_Canvas">
<jscomp compilationLevel="simple" warning="quiet"
- debug="false" output="cocos2d-html5-alpha-canvasmenu.js">
+ debug="false" output="cocos2d-html5-alpha-canvasmenu-min.js">
<sources dir="${basedir}">
<file name="platform/CCClass.js"/>
<file name="platform/CCCommon.js"/>
@@ -90,7 +90,7 @@
<target name="compile_Dom">
<jscomp compilationLevel="simple" warning="quiet"
- debug="false" output="cocos2d-html5-alpha-dommenu.js">
+ debug="false" output="cocos2d-html5-alpha-dommenu-min.js">
<sources dir="${basedir}">
<file name="platform/CCClass.js"/>
<file name="platform/CCCommon.js"/>
View
20 index.html
@@ -1,10 +1,8 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE HTML>
<html>
<head>
- <title></title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Cocos2d-HTML5</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="icon"
type="image/GIF"
href="tests/Resources/Images/favicon.ico" />
@@ -54,9 +52,19 @@
<ol>
<li><a href="HelloWorld/HelloWorld.html">Hello World</a> <span
class="comment"> - Hello World for Cocos2d-HTML5</span></li>
- <li><a href="tests">Test cases</a> <span class="comment"> - Engine Testcases</span></li>
- <li><a href="tests/indexDom.html">Test cases in Dom Menu</a> <span class="comment"> - Same API, Menu and items are implemented in DOM HTML</span></li>
+ <li><a href="tests/index.html">Test cases</a> <span class="comment"> - Engine Testcases</span></li>
<li><a href="Demo/demo.html">Demos</a> <span class="comment"> - Platform Demos</span></li>
</ol>
+<hr/>
+<h2>Note</h2>
+<div style = "width:800px">
+<p>While games written with Cocos2d-html5 should work offline, but some browsers won't allow this to happen. Browsers that deny access to certain functions such as XMLHttpRequest that fails for "file:// " protocol, but Cocos2d-html5 engine depend on this to read many files such as a .plist file.</p>
+<p>Firefox 12, and Opera are notable exceptions.</p>
+<p>If you wish to use other browsers, you need a webserver. It doesn't mean a seperate computer, you can download a free webserver program to your computer. Here is some popular webserver program:
+ <ul><li><a href="http://www.apachefriends.org/en/xampp.html">XAMPP</a>: for windows, Mac, Linux</li><li><a href="http://www.wampserver.com/en/">WAMP</a>: for windows</li><li><a href="http://www.mamp.info/en/index.html">MAMP</a>: for Mac</li></ul>
+Once you install a webserver, go to your installation directory, there should be a directory called "htdocs" or "www", place Cocos2d-html5 files in there. Then point your browser to http://localhost/.</p>
+
+<p>Cocos2d-html5 should now work without any errors</p>
+</div>
</body>
</html>
View
2  tests/build.xml
@@ -2,7 +2,7 @@
<project name="Javascript compress project" basedir="." default="compile_test">
<taskdef name="jscomp" classname="com.google.javascript.jscomp.ant.CompileTask"
- classpath="${basedir}/compiler.jar"/>
+ classpath="${basedir}../tools/compiler/compiler.jar"/>
<target name="compile_test">
<jscomp compilationLevel="simple" warning="quiet"
View
202 tests/testbasicDom.js
@@ -1,202 +0,0 @@
-/****************************************************************************
- Copyright (c) 2010-2012 cocos2d-x.org
- Copyright (c) 2008-2010 Ricardo Quesada
- Copyright (c) 2011 Zynga Inc.
-
- http://www.cocos2d-x.org
-
- Created by JetBrains WebStorm.
- User: wuhao
- Date: 12-4-5
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- ****************************************************************************/
-
-
-var cc = cc = cc || {};
-
-var TestScene = cc.Scene.extend({
- _portrait:false,
- ctor:function (bPortrait) {
- this._super();
- this._portrait = bPortrait;
- if (this._portrait) {
- cc.Director.sharedDirector().setDeviceOrientation(cc.DeviceOrientationLandscapeRight);
- }
- this.init();
- },
- onEnter:function () {
- this._super();
- var label = cc.LabelTTF.labelWithString("MainMenu", "Arial", 20);
- var pMenuItem = cc.MenuItemLabel.itemWithLabel(label, this, this.MainMenuCallback);
-
- var pMenu = cc.Menu.menuWithItems(pMenuItem, null);
- var s = cc.Director.sharedDirector().getWinSize();
- pMenu.setPosition(cc.PointZero());
- pMenuItem.setPosition(cc.PointMake(s.width - 50, 25));
-
- this.addChild(pMenu, 1);
- },
- runThisTest:function () {
-
- },
- MainMenuCallback:function () {
- window.pScene = cc.Scene.node();
- var pLayer = new TestController();
- pScene.addChild(pLayer);
- cc.Director.sharedDirector().replaceScene(pScene);
- },
- type:"testscene"
-});
-//Controller stuff
-var LINE_SPACE = 40;
-var s_pPathClose = null;
-var s_tCurPos = cc.PointZero();
-var TestController = cc.Layer.extend({
- _m_pItemMenu:null,
- _m_tBeginPos:cc.PointZero(),
- bIsMouseDown:false,
- id:"test Controller",
- ctor:function () {
- this._super();
- // add close menu
- if (!s_pPathClose) {
- s_pPathClose = cc.TextureCache.sharedTextureCache().textureForKey("Resources/CloseNormal.png");
- }
- var pCloseItem = cc.MenuItemImage.itemFromNormalImage(s_pPathClose, s_pPathClose, this, this.closeCallback);
- var pMenu = cc.Menu.menuWithItems(pCloseItem, null);//pmenu is just a holder for the close button
- var s = cc.Director.sharedDirector().getWinSize();
- pMenu.setPosition(cc.PointZero());
- pCloseItem.setPosition(cc.PointMake(s.width - 30, s.height - 30));
-
- // add menu items for tests
- this._m_pItemMenu = cc.Menu.menuWithItems(null);//item menu is where all the label goes, and the one gets scrolled
- var i = 0;
- for (var text in g_aTestNames) {
- var label = cc.LabelTTF.labelWithString(text, "Arial", 24);
- var pMenuItem = cc.MenuItemLabel.itemWithLabel(label, this, this.menuCallback);
- pMenuItem.id(text);
- this._m_pItemMenu.addChild(pMenuItem);
- pMenuItem.setPosition(s.width / 2, (s.height - (i + 1) * LINE_SPACE));
- i++;
- }
- this._m_pItemMenu.setContentSize(cc.SizeMake(s.width, (i + 1) * LINE_SPACE));
- this._m_pItemMenu.setPosition(s_tCurPos);
- this.setIsTouchEnabled(true);
- this.addChild(this._m_pItemMenu);
- this.addChild(pMenu, 1);
- },
- menuCallback:function (pSender) {
- // get the userdata, it's the index of the menu item clicked
- //var pMenuItem = pSender;
- var nIdx = pSender.target.id;
-
- // create the test scene and run it
- var pScene = new window[g_aTestNames[nIdx]]();
- if (pScene) {
- pScene.runThisTest();
- }
- },
- closeCallback:function () {
- history.go(-1);
- },
- ccTouchesBegan:function (pTouches, pEvent) {
- if (!this.bIsMouseDown) {
- //this._m_tBeginPos = cc.ccp(pTouches[0].locationInView(0).x, pTouches[0].locationInView(0).y);
- this._m_tBeginPos = pTouches[0].locationInView(0).y;
- }
- this.bIsMouseDown = true;
-
- },
- ccTouchesMoved:function (pTouches, pEvent) {
- if (this.bIsMouseDown) {
- var touchLocation = pTouches[0].locationInView(0).y;
- var nMoveY = touchLocation - this._m_tBeginPos;
- var curPos = cc.ccp(this._m_pItemMenu.getPosition().x, this._m_pItemMenu.getPosition().y);
-
- var nextPos = cc.ccp(curPos.x, curPos.y + nMoveY);
- var winSize = cc.Director.sharedDirector().getWinSize();
- if (nextPos.y < 0.0) {
- this._m_pItemMenu.setPosition(cc.PointZero());
- return;
- }
- var testlength = 0;
- for(var k in g_aTestNames){testlength++}
- if (nextPos.y > ((testlength + 1) * LINE_SPACE - winSize.height)) {
- this._m_pItemMenu.setPosition(cc.ccp(0, ((testlength + 1) * LINE_SPACE - winSize.height)));
- return;
- }
- this._m_pItemMenu.setPosition(nextPos);
- this._m_tBeginPos = cc.ccp(0, touchLocation).y;
-
- s_tCurPos = nextPos;
- }
- },
- ccTouchesEnded:function () {
- this.bIsMouseDown = false;
- }
-});
-
-var g_aTestNames = {
- //"Accelerometer":"AccelerometerTestScene",
-
- "ActionManagerTest":"ActionManagerTestScene",
- "ActionsTest":"ActionsTestScene",
- "Box2dTest":"Box2DTestScene",
- //"Box2dTestBed":"Box2dTestBedScene",
- //"BugsTest":"BugsTestScene",
- //"ChipmunkTest":"ChipmunkTestScene",
- "ClickAndMoveTest":"ClickAndMoveTestScene",
- "CocosDenshionTest":"CocosDenshionTestScene",
- "CocosNodeTest":"CocosNodeTestScene",
- //"CurlTest":"CurlTestScene",
- "CurrentLanguageTest":"CurrentLanguageTestScene",
- "DirectorTest":"DirectorTestScene",
- "DrawPrimitivesTest":"DrawPrimitivesTestScene",
- "EaseActionsTest":"EaseActionsTestScene",
- //"EffectsTest":"EffectTestScene",
- //"EffectAdvancedTest":"EffectAdvanceScene",
- //"ExtensionsTest":"ExtensionsTestScene"
- "FontTest":"FontTestScene",
- //"HiResTest":"HiResTestScene",
- "IntervalTest":"IntervalTestScene",
- //"KeypadTest":"KeypadTestScene",
- "LabelTest":"LabelTestScene",
- "LayerTest":"LayerTestScene",
- "MenuTest":"MenuTestScene",
- //"MotionStreakTest":"MotionStreakTestScene",
- "ParallaxTest":"ParallaxTestScene",
- "ParticleTest":"ParticleTestScene",
- "PerformanceTest":"PerformanceTestScene",
- "ProgressActionsTest":"ProgressActionsTestScene",
- //"RenderTextureTest":"RenderTextureScene",
- "RotateWorldTest":"RotateWorldTestScene",
- "SceneTest":"SceneTestScene",
- "SchedulerTest":"SchedulerTestScene",
- "SpriteTest":"SpriteTestScene",
- "TextInputTest":"TextInputTestScene",
- //"Texture2DTest":"TextureTestScene",
- "TextureCacheTest":"TextureCacheTestScene",
- "TileMapTest":"TileMapTestScene",
- "TouchesTest":"PongScene",
- "TransitionsTest":"TransitionsTestScene"
- //"UserDefaultTest":"UserDefaultTestScene",
- //"ZwoptexTest":"ZwoptexTestScene",
-
-};
View
6 tools/readme for tools.txt
@@ -0,0 +1,6 @@
+Compliler:
+
+Default compliler is goole closure compiler. Please install Ant and Jre to build.
+The shell files and Closure Compiler which Ant needs are provided in tools folder and cocos2d folder.
+
+Reference wiki: www.cocos2d-x.org/projects/cocos2d-x/wiki/Closure_Compiler
Please sign in to comment.
Something went wrong with that request. Please try again.