The cocos2d-x-js tag has no usage guidance.
1
vote
0answers
19 views
How can I make a sprite based animation using Cocos2d JS?
I am learning Cocos2d JS, but I can find very few tutorials and I find the documentation very vague. I can put a simple image on a layer like this:
var sprite = new cc.Sprite(res.my_image_png);
...
1
vote
1answer
37 views
Color Based Collision Javascript (Cocos2d-js)
Im looking to make an isometric game...so my partner designed the isometric map (jpg image) along with the map objects (png) on adobe ilustrator... so the thing is i would like to set the player path ...
0
votes
0answers
20 views
Can project.json jsList accept folder names?
Using cocos2d for the web/js, it seems every script file must be explicitly added to project.json. Is there a way to give it a path instead, and it will load all scripts in the folder (and sub-folders ...
1
vote
0answers
68 views
Error with Cocos2d-JS when using Skeletal animation from Cocos Studio
Here is the JavaScript code:
var size = cc.winSize;
ccs.ArmatureDataManager.getInstance().addArmatureFileInfo(res.skeleton);
// The error comes from the following line
var armature = ...
0
votes
0answers
40 views
How to force nearest neighbor in cocos2d-js for upscaling?
I made a test project and set the design resolution to 240x160:
cc.view.setDesignResolutionSize(240, 160, cc.ResolutionPolicy.SHOW_ALL);
When I run the game as a native OS X app using a window size ...
0
votes
2answers
192 views
Saving data in the local computer with cocos2d-js
Making a game with cocos2d-js, is there a reliable way to create saved data in my local computer? I see that there is cc.sys.localStorage but it is removed if the user clears the browser's cache or ...
0
votes
1answer
103 views
Location of project.json in Cocos2d-JS
I am learning Cocos2d-JS to develop web-based games with Javascript. In Cocos2d-JS there is project.json file which defines game configuration.
Is it possible to place this file in another location ...
0
votes
0answers
95 views
Embedding a video inside cocos2-js for browser
Is there a way to insert a video frame, a video popup, or maybe a video as a sprite with audio as separate asset in a layer?
The project will be a browser app and I am using cocos2d-js, and apart ...
0
votes
0answers
268 views
Cocos2d-JS using mulitpacked sprite
I wanted to ask on how to use a sprite packed into multiple sprite sheets (multipack in texturePacker). I tried this but it doesn't work:
var bgCrumbleLayer = cc.Layer.extend({
...
1
vote
0answers
148 views
Best way to transition between multiple Cocostudio defined scenes
I'm designing a game that has to switch between multiple game scenes. Each scene has been created in cocostudio and is imported into the code as a json file as:
var obj = ccs.load(res.Symbols_json);
...
0
votes
0answers
76 views
cocos2d-x : set search path not working
im using cocos2d-x javascript and i tried to set search path or asset for multi resolution devices like so
in main.js file
if (cc.sys.isNative) { // if game is native
assetsPath = ...
0
votes
0answers
36 views
Can't override velocity_func when compiling cocos2d-x JavaScript in IOS?
I am attempting to overwrite the Chipmunk's Body.prototype.velocity_func. It works perfectly when viewing my game via HTML5 Canvas, but when I compile my Xcode project, the velocity_func is never ...
0
votes
0answers
147 views
Convert Cocos2d-x JS Sprite to PhysicsSprite?
I have a Cocos Studio project that has a node that contain multiple sprites. I am loading this node and iterating through the children (each are a cc.Sprite object);
I'd like to convert each ...
1
vote
1answer
503 views
Cocos2D-JS Windows App in fullscreen mode (Win32)
I've been looking for a way to make my Cocos2D-JS app go into fullscreen mode, but there doesn't seem to be much documentation on Cocos2D-JS (or Cocos2D-x-js as some seem to call it.)
This app is to ...
0
votes
1answer
86 views
Cocos Code IDE unable to find python
I am trying to create a new JavaScript project on Cocos Code IDE but every time it immediately give me the error message:
Unable to find python. Please, click the setting button to set the python ...
1
vote
1answer
1k views
What is the difference between a Facebook Canvas and Facebook Web project?
I am making a game on cocos2d-JS for Facebook. What is the difference between Facebook Canvas & Facebook Web project. From what I can tell, Facebook Canvas ask for the secure url and Web ask for ...
5
votes
1answer
658 views
How to read a color of a pixel from texture (cocos2d-js)?
How to read a color of a pixel at [x,y] from a texture (in cocos2d-js)?
1
vote
2answers
1k views
How do I create a message box that fires a callback on button press?
I need to create a message box with an "OK"-button. When the user touches the button, it should execute a callback. I'm new to this and couldn't find any articles in the docs.
5
votes
1answer
6k views
difference between cocos2d-x vs cocos2d-js
I'm just moving towards native apps... A friend of mine told me to start with cocos2d, I'm good in javascript. While searching google for cocos2d, and within cocos2d-x.org I found
cocos2d-x
...
1
vote
2answers
788 views
How can I list files in a folder from JavaScript in cocos2d-x?
I need to list all the files in the res folder from a JavaScript script in cocos2d-x. What would be the most efficient way to do this?
To keep compatibility with Cocos2d-html5 a JavaScript-only ...