Page 1 of 1

ccui is not defined

PostPosted: Sun Sep 13, 2015 9:57 pm
by BenChang
Problem: you try to use UI widgets such as ccui.TextField, but get an error that ccui is not defined

Solution: in projects.json add the "extensions" to the list of modules that Cocos will load

For example:
Code: Select all
{
    "project_type": "javascript",

    "debugMode" : 1,
    "showFPS" : false,
    "frameRate" : 60,
    "id" : "gameCanvas",
    "renderMode" : 0,
    "engineDir":"frameworks/cocos2d-html5",

    "modules" : ["cocos2d","extensions"],

    "jsList" : [
        "src/resource.js",
        "src/app.js",
        "src/Urchin.js",
        "src/Squid.js",
        "src/Gem.js",
        "src/UI.js"
    ]
}