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
0 answers

Right click with cocos2d-html5

I use cocos2d-html5 2.2.2, onMouseUp function detects left and middle click, but right clicks have no effect. I use Firefox 27. Is there something I should enable to support right clicks ? Thanks for your help.
azmeuk
  • 4,026
  • 3
  • 37
  • 64
0
votes
1 answer

res/baseResource.plist is not a plist file or you forgot to preload the plist file

I am trying out the samples that come with Cocos2d-html-v2.2.2 The frameworks seems to run fine, but there is a problem with theincluded games. FruitAttack gives me the following error on the Developer Console Uncaught cocos2d:…
0
votes
2 answers

How can I call native ios api from cocos2d html5 with javascript binding project?

Can cocos2d html5 with javacript binding project for ios call ios native api? I am looking for the way to access the ios device camera, photos, etc.
Emmy
  • 3,949
  • 5
  • 28
  • 30
0
votes
1 answer

Cocos2d: Sequence of actions when touched, queuing by touch

I have a problem regarding with the touch and move. I want to move a sprite by following the set of touches but it moves in different ways when i clicked many times. here's my code so far: moveObject : function(position){ var moveTest…
0
votes
1 answer

Drawing arc cocos2d-html5

I'm trying to draw arc on cocos2d-html5, but cant find function to use. DrawSegment used parameters point,point,radius,color. But radius - width of line, not arc. What can I use to draw arc?
0
votes
1 answer

Canvas turns blank when calling director.setDisplayStats(false); to hide FPS counter

I'm new to Cocos2d-HTML5, but think I'm getting the basics well enough. However, while following this tutorial, I'm hitting a weird snag. Since I'm using Cocos2d-HTML5 v2.2.1, I updated the cocos2dApp class declaration as described in the comment…
smashuu
  • 193
  • 1
  • 7
0
votes
1 answer

cc.sprite.create not working? cocos2d-html

I am new to Cocos2d-html5 v2.2.1 and I am trying to add a sprite (simple image) to the canvas. The code does add an image with the correct width and height but it is just black. I cant seem to find any errors so I am kinda stuck. Any help would be…
1000Suns
  • 251
  • 1
  • 3
  • 16
0
votes
1 answer

cocos2d-html5 menuItem callback

i'm new on Cocos2d-html5. i'm making some samples and i can't run a menu item callback. Menu item sprite is drawed on canvas but doesn't working can someone help me. var primeraEscena = cc.Scene.extend({ onEnter:function(){ this._super(); …
0
votes
1 answer

Cocos2d-html5 light processing

I am using cocos2d-html5(http://www.cocos2d-x.org/) engine for my html5 game. I want to add light processing. Something like this http://code.google.com/p/box2dlights/. Are there any solutions?
DenisM
  • 223
  • 4
  • 13
0
votes
1 answer

Strange behavior of convertToWorldSpace for MenuItems in CCMenu

I have a menu attached to the layer . In the menu 4 items aligned vertically. I decleare the menu in this way (Warning! This is Javascript. Using COCOS2D-Html5, the framework is the same as per iphone): menuHeight =…
Claudio Ferraro
  • 4,551
  • 6
  • 43
  • 78
0
votes
1 answer

How to easily port a cocos2d-html5 app to cocos2d-iphone

I wrote a cocos2d-html5 app. Due to performance issues I need to port it to native cocos2d-iphone. How can I do it easily. I heard about javascript-bindings and stuff like that. I'm not sure if this is possible. What is the best way to proceed ?
Claudio Ferraro
  • 4,551
  • 6
  • 43
  • 78
0
votes
2 answers

Fastest way to resize (zoom) a group of sprites in cocos2d

I wanna to zoom a group of about 10 sprites at the same time. The sprites are different sprite layers with transparent background. I'm trying to preattach all the sprite at first to the layer and store the reference in an array. After that as I…
Claudio Ferraro
  • 4,551
  • 6
  • 43
  • 78
0
votes
1 answer

cocos2d-html5 Mouse click event not working

I am developing a Cocos2d-HTML5 based game. I am trying to handle mouse click event in my code like below. This is added in 'cc.Layer.extend' class. When i tested the code, it is not detecting the mouse click event, it is doing nothing when i click…
0
votes
2 answers

cocos2d-html5 onMouseDown, how to get converted position in browser?

In cocos2d-html5, I can get mouse event using this method, onMouseDown:function( event ) { var loc = event.getLocation(); console.debug( loc ); } So in Chrome browser console, I can see the clicked location. but, the location is not…
Jinbom Heo
  • 7,248
  • 14
  • 52
  • 59
0
votes
1 answer

Cocos2D - HTML code encryption

I am writing a game in cocos2d width javaScript. All my gameCode will be in JS for cross-platform reasons, and I need to know if I can protect my code and content from sneaky eyes.. I have to encrypt the code in cocos2D-iPhone, cocos2D-x and…