cocos2d-js , cc.ScrolView undefined in cocos2d-js

cc.ScrolView undefined in cocos2d-js


Tag: cocos2d-js

I tried to use ScrollView, TableView from cocos2d-js extensions and I noticed that it can't be seen!

I also tried to create a class from that example but i need to use from native class!


In order to load extensions, you should add "extensions" in "module" section in project.json. For example:

{ ... "module": ["cocos2d", "extensions"] }


how can Cocos2d-JS read txt and update the file

I am working on a game that allows users to define a "dictionary" of question/answer pairs. Then, users can import the "dictionary" to the Game Scene and practice with the questions inside the "dictionary". The question is how can I do this with Cocos2d-JS? Or, I should use LocalStorage API?...

cc.textureCache.addImage blocking UI

I want to cache lot of textures in a running scene without blocking it, theoretically cc.textureCache.addImage do caching async if you call it the three arguments. This is not happening. Code: rainOfArrows: { _animFrames:[], loaded: function(){ console.log('>>>>>>>>>>>>>>LOAD!') }, load: function(){ /* Load all animation arrow sprites in memory & generate...

cocos2dx 3.3 animation implementation

I am new in cocos2dx development.I almost learn all basic level of cocos2dx (version 3.3) in android using cpp language. I showing that there are lots of update over In android I am currently developing the tetris game using cocos2dx version 3.3, I want to know what is the...

xml.Unmarshal error: expected element type but have

I try to unmarshal a XML file using xml.Unmarshal of "encoding/xml" package. The XML file starts like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ""> <plist version="1.0"> <dict> <key>frames</key> <dict> <key>0</key> <dict> <key>frame</key> <string>{{0, 0}, {81, 145}}</string> <key>offset</key> <string>{0, 0}</string>...

Progress Timer Cocos JS v3

I'm newbie in cocos-js. I want to make a health bar in cocos JS and try this code. And i choose to use Progress Timer. But when i use this code, it just show the bar, no running action. What's wrong ? var healthBar = cc.ProgressTimer.create(cc.Sprite.create("health_bar1.png")); healthBar.setType(cc.PROGRESS_TIMER_TYPE_BAR); healthBar.setBarChangeRate(cc.p(1,0)); healthBar.setMidpoint(cc.p(0,0)); this.addChild(healthBar,...

Read data saved with CCUserDefault

I’m converting my game from cocos2d-x 2.2.3 to cocos2d-js 3.2, but the players already have saved progress using the old CCUserDefaults. Now that I have to use localStorage in cocos2d-js, how can I read the old data that was saved using CCUserDefaults? I don’t want players to lose their progress...

Create Dynamic Body using cocos 2d js and Chipmunk

I am fairly new to cocos 2d and chipmunk. So far i have managed to create a static object and add collision handler to it. But i want to create a dynamic.`` = space; this.sprite = new cc.PhysicsSprite("#rock.png"); var body = new cp.StaticBody(); body.setPos(pos); this.sprite.setBody(body); this.shape = new cp.BoxShape(body, this.sprite.getContentSize().width,...

cc.ScrolView undefined in cocos2d-js

I tried to use ScrollView, TableView from cocos2d-js extensions and I noticed that it can't be seen! I also tried to create a class from that example but i need to use from native class!...

How to host an cocos2d-js web only game?

I'm very confused. Before I run an simple webonly cocos2d-js example, I was under the impression it generates the html5 + js files so I can host it everywhere or either run offline. But it is not the case, to run my example locally I have to start an cocos...

how to port cocos2d-js to android and iphone(ipad) in cocos code ide

I am new cocos2d developer. I am studying cocos2d-js using cocos code Ide in windows. My programming language for cocos2d-js is javascript. Cocos code Ide provides good editing and testing enviroment to develop cocos2d-js. but I can't generate from the project in cocos code Ide to the release products...