Skip to content

Commit 186a9fa

Browse files
author
SeanLin
committed
Merge pull request cocos2d#300 from linshun/iss1234_AlphaVersion
Add super init and fixed index note for alpha version
2 parents 4ff0c5c + 6014d90 commit 186a9fa

File tree

5 files changed

+8
-12
lines changed

5 files changed

+8
-12
lines changed

Demo/HelloDomMenu/HelloDom.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ var Helloworld = cc.Layer.extend({
6060
var selfPointer = this;
6161
//////////////////////////////
6262
// 1. super init first
63-
/*var test = this._super();
64-
cc.LOG(test);
65-
if (!test) {
66-
return false;
67-
}*/
63+
this._super();
6864

6965
var size = cc.Director.sharedDirector().getWinSize();
7066

@@ -76,7 +72,7 @@ var Helloworld = cc.Layer.extend({
7672

7773
// add "HelloWorld" splash screen"
7874
this.pSprite = cc.Sprite.spriteWithFile("Resources/HelloWorld.png");
79-
this.pSprite.setPosition(cc.ccp(cc.Director.sharedDirector().getWinSize().width / 2, cc.Director.sharedDirector().getWinSize().height / 2));
75+
this.pSprite.setPosition(cc.ccp(size.width / 2, size.height / 2));
8076
this.pSprite.setIsVisible(true);
8177
this.pSprite.setAnchorPoint(cc.ccp(0.5, 0.5));
8278
this.pSprite.setScale(0.5);

Demo/HelloWorldTutorial/Helloworld.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ var Helloworld = cc.Layer.extend({
5555
var selfPointer = this;
5656
//////////////////////////////
5757
// 1. super init first
58+
this._super();
59+
5860
/////////////////////////////
5961
// 2. add a menu item with "X" image, which is clicked to quit the program
6062
// you may modify it.

Demo/NativeClientDemo/NativeClient.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,7 @@ var Helloworld = cc.Layer.extend({
139139
var selfPointer = this;
140140
//////////////////////////////
141141
// 1. super init first
142-
var test = this._super();
143-
cc.LOG(test);
144-
if (!test) {
145-
return false;
146-
}
142+
this._super();
147143

148144
/////////////////////////////
149145
// 2. add a menu item with "X" image, which is clicked to quit the program

HelloWorld/Helloworld.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ var Helloworld = cc.Layer.extend({
3535

3636
//////////////////////////////
3737
// 1. super init first
38+
this._super();
39+
3840
/////////////////////////////
3941
// 2. add a menu item with "X" image, which is clicked to quit the program
4042
// you may modify it.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h1><a href="index.html"><img src="tests/Resources/Images/cocos2dbanner.png"/></
5959
<h2>Note</h2>
6060
<div style = "width:800px">
6161
<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>
62-
<p>Firefox 12, and Opera are notable exceptions.</p>
62+
<p>Some versions of Firefox, Safari and Opera are notable exceptions.</p>
6363
<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:
6464
<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>
6565
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>

0 commit comments

Comments
 (0)