I am converting my project from cocos2dx 2.0.4 to cocos2d-js 3.0 ,i am unable to find alternative to CCUserDefault for setting Value for key in javascript. I have tried refering the cocos2d-js API documentation,but din't get any other similar function can anybody please tell me alternative for this command..i am new to cocos2d-js 3.0,unable to figure out
Asked
Active
Viewed 978 times
0
-
I'm not familiar with that function, all I could find much about it at a glance.. What was it for, exactly? Was it some way to store save game data and such information? If so, take a look at [this answer](http://stackoverflow.com/questions/26242672/how-to-save-a-variable-to-android-using-cocos2d-js/26247665#26247665). – Sebastián Vansteenkiste Oct 20 '14 at 02:18
1 Answers
0
Use the cc.sys.localStorage:
cc.sys.localStorage.getItem(key);
cc.sys.localStorage.setItem(key, value);
cc.sys.localStorage.removeItem(key);

musikov
- 640
- 1
- 4
- 13