Questions tagged [cocos2d-html5]

An open-source web 2D game framework, cross platforms between browsers and native applications with the C++ bindings to cocos2d-x.

Cocos2d-html5 is an open-source web 2D game framework, released under MIT License. It is a HTML5 version of Cocos2d-x project. The focus for Cocos2d-html5 development is around making Cocos2d cross platforms between browsers and native applications. On top of the framework provided by Cocos2d-html5, games can be written in Javascript, using an API that is COMPLETELY COMPATIBLE with that of Cocos2d-x javascript binding. Cocos2d-html5 project can be easily run on browsers which supports HTML5. Cocos2d-html5 also supports running game code in "Cocos2d Javascript binding" without or with little modification.

63 questions
0
votes
1 answer

How GlobalZOrder works in cocos2d-js?

I have nested tree: self.addChild(red); self.addChild(green); green.addChild(blue); I get this: (Screenshot) How can I put blue square behind others, without changing my tree to make it look like this: (Screenshot) setGlobalZOrder(), does…
0
votes
1 answer

How to remove initial background image when starting a cocos2d-html project?

Initially when a cocos2d-html5 project starts (in the web browser), there is a background image showing cocos2d. How does one remove or change it ? This appears just after the loading screen. I cannot find a reference to it anywhere in code.
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
0
votes
1 answer

Cocos2d-x JS 3.7.1 touch event MAC issue

We now working on our first cocos2d-x JS project, got trouble running MAC project. For WEB it's working correctly. We have created following eventListener: var MouseFetcher; MouseFetcher = cc.EventListener.create({ event:…
0
votes
1 answer

iOS app loads html , can I change the url prefix

I just took over the company's app, the app needs to load html to play a cocos2d-html5 game. Loading the index.html and the url prefix of index.html is file:///, but the code contains a judgment, if the url prefix contains negame:// then some…
Pis.Y.Chen
  • 13
  • 7
0
votes
1 answer

Setting Schedule in Custom Layer and Callback Not Firing

I am working on a simple reusable custom Layer in Cocos2d-html5 to manage a classic continuous background scroller. I initially created this in my main game layer, where I got it working, but when I moved it to its own BackgroundScroller Layer…
0
votes
1 answer

cannot read property 'setTitleText' of undefined - ccui.Button

I am unable to setTitle Text for ccui.Buttona a widget, its showing cannot read property 'setTitleText' of undefined in Cocos2d-JS Here's the code SolutionGrid.setEmptySolutionBox = function(selChild,rChar) { selChild.active = true; …
user1169079
  • 3,053
  • 5
  • 42
  • 71
0
votes
2 answers

How to create chipmunk debug layer with Cocos2d-JS v3?

How to create chipmunk debug layer with Cocos2d-JS v3? I could not find an example of how to do it.
Tolsi
  • 656
  • 9
  • 20
0
votes
2 answers

cocos2d-html5 get sprite from cache plist

I am using cocos2d-js v3.0 with html5 and I am loading a plist into cache and them I am trying to create a sprite from. I am getting the error [Error] Failed to load resource: the server responded with a status of 404 (Not Found) (player-stand-f-0,…
Keith Power
  • 13,891
  • 22
  • 66
  • 135
0
votes
1 answer

How to catch text input in cocos2d-html5?

I have to catch input from the user using cocos2d-html5. EditBox component has a glitch with zOrder. Everything that is set to be above it happens to be under it. As for the other components (TextFieldTTF, UICCTexField) - they are not visible in the…
Akima
  • 121
  • 8
0
votes
1 answer

Cocos2d-JS HTML 3.0 not registering mouse input

I am trying to register when I move the mouse and clicks, but I cant get it to react I have the following where my keyboard inputs are fine and I get a log message printed fine with whatever key I press, but with my mouse the only thing I get is…
Mech0z
  • 3,627
  • 6
  • 49
  • 85
0
votes
2 answers

Cocos2d-JS 3.0 migration

I'm moving from cocos2d-html5 version 2.2 to cocos2d-js 3.0 and I have a problem with this code (which works perfectly in version 2.2): menuButtons = cc.Menu.create(); for (var a = 1; a < 6; a++){ var label =…
0
votes
1 answer

Native calls from CCXWebView in cocos2d-js project

I have a game written in coco2d-js v3.0, which I've embedded it into a web page. Now in order to run this web page (with my game in it) on a mobile device I need to use CCXWebView (or kind of). Can I still got the native calls for a game even…
netanalyzer
  • 634
  • 2
  • 6
  • 23
0
votes
1 answer

Attempting to animate two different sprites sequentially

Hoping someone can help me here. I am attempting to sequentially runAction on two sprites. If I remove hand.setScale the same result occurs as the code below, i.e. the sprite covers the entire screen (800x600). hand sprite is 13px x 12px. If modify…
Bruno
  • 17
  • 4
0
votes
1 answer

Make a cocos HTML game go full screen by pressing a button within the canvas

I have an HTML game using the cocos 2D game engine and javascript. I have an image within the canvas, on clicking which I want the image to go full screen. Please don't confuse this question with doing this:…
user81371
  • 91
  • 1
  • 10
0
votes
1 answer

Get All Children in Cocos2d-html5

I try many ways to get all children in a cc.Layer In my Layer, i have 2 childrens. I using the following code to get all children and runAction FadeOut for all children in my Layer for (var child in this._children){ child.runAction( …
Jonny Vu
  • 1,420
  • 2
  • 13
  • 32