Update some GuiConstants and resubmission pr#6361.

This commit is contained in:
samuele3hu 2014-05-15 16:54:55 +08:00
parent 95dfbf7dae
commit cde4e4811b
5 changed files with 55 additions and 47 deletions

View File

@ -34,7 +34,7 @@
static int tolua_cocos2d_MenuItemImage_create(lua_State* tolua_S)
{
if (NULL == tolua_S)
if (nullptr == tolua_S)
return 0;
int argc = 0;
@ -58,47 +58,51 @@ static int tolua_cocos2d_MenuItemImage_create(lua_State* tolua_S)
}
} while (0);
do {
if (argc == 2)
{
#if COCOS2D_DEBUG >= 1
if (!tolua_isstring(tolua_S,2,0,&tolua_err) ||
!tolua_isstring(tolua_S,3,0,&tolua_err))
{
ok = false;
}
if (!tolua_isstring(tolua_S,2,0,&tolua_err) ||
!tolua_isstring(tolua_S,3,0,&tolua_err))
{
ok = false;
}
#endif
if (!ok)
{
ok = true;
break;
if (!ok)
{
ok = true;
break;
}
const std::string normalImage = ((const std::string) tolua_tocppstring(tolua_S,2,0));
const std::string selectedImage = ((const std::string) tolua_tocppstring(tolua_S,3,0));
MenuItemImage* tolua_ret = (MenuItemImage*) MenuItemImage::create(normalImage,selectedImage);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.MenuItemImage");
return 1;
}
const std::string normalImage = ((const std::string) tolua_tocppstring(tolua_S,2,0));
const std::string selectedImage = ((const std::string) tolua_tocppstring(tolua_S,3,0));
MenuItemImage* tolua_ret = (MenuItemImage*) MenuItemImage::create(normalImage,selectedImage);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.MenuItemImage");
return 1;
} while (0);
do {
#if COCOS2D_DEBUG >= 1
if (!tolua_isstring(tolua_S,2,0,&tolua_err) ||
!tolua_isstring(tolua_S,3,0,&tolua_err) ||
!tolua_isstring(tolua_S,4,0,&tolua_err) )
if (argc == 3)
{
goto tolua_lerror;
break;
}
#if COCOS2D_DEBUG >= 1
if (!tolua_isstring(tolua_S,2,0,&tolua_err) ||
!tolua_isstring(tolua_S,3,0,&tolua_err) ||
!tolua_isstring(tolua_S,4,0,&tolua_err) )
{
goto tolua_lerror;
break;
}
#endif
const std::string normalImage = ((const std::string) tolua_tocppstring(tolua_S,2,0));
const std::string selectedImage = ((const std::string) tolua_tocppstring(tolua_S,3,0));
const std::string disabledImage = ((const std::string) tolua_tocppstring(tolua_S,4,0));
MenuItemImage* tolua_ret = (MenuItemImage*) MenuItemImage::create(normalImage,selectedImage,disabledImage);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.MenuItemImage");
return 1;
const std::string normalImage = ((const std::string) tolua_tocppstring(tolua_S,2,0));
const std::string selectedImage = ((const std::string) tolua_tocppstring(tolua_S,3,0));
const std::string disabledImage = ((const std::string) tolua_tocppstring(tolua_S,4,0));
MenuItemImage* tolua_ret = (MenuItemImage*) MenuItemImage::create(normalImage,selectedImage,disabledImage);
int nID = (tolua_ret) ? (int)tolua_ret->_ID : -1;
int* pLuaID = (tolua_ret) ? &tolua_ret->_luaID : NULL;
toluafix_pushusertype_ccobject(tolua_S, nID, pLuaID, (void*)tolua_ret,"cc.MenuItemImage");
return 1;
}
} while (0);
CCLOG("'create' has wrong number of arguments: %d, was expecting %d\n", argc, 0);

View File

@ -487,9 +487,8 @@ ccui.LoadingBarType = ccui.LoadingBarDirection
ccui.LoadingBarType.left = ccui.LoadingBarDirection.LEFT
ccui.LoadingBarType.right = ccui.LoadingBarDirection.RIGHT
ccui.LayoutType = ccui.Type
ccui.LayoutType.absolute = ccui.Type.ABSOLUTE
ccui.LayoutType.linearVertical = ccui.Type.VERTICAL
ccui.LayoutType.linearHorizontal = ccui.Type.HORIZONTAL
ccui.LayoutType.relative = ccui.Type.RELATIVE
ccui.LayoutType.absolute = ccui.LayoutType.ABSOLUTE
ccui.LayoutType.linearVertical = ccui.LayoutType.VERTICAL
ccui.LayoutType.linearHorizontal = ccui.LayoutType.HORIZONTAL
ccui.LayoutType.relative = ccui.LayoutType.RELATIVE

View File

@ -53,7 +53,7 @@ ccui.LayoutBackGroundColorType =
gradient = 2,
}
ccui.Type =
ccui.LayoutType =
{
ABSOLUTE = 0,
VERTICAL = 1,
@ -171,3 +171,8 @@ ccui.ListViewGravity = {
bottom = 4 ,
centerVertical = 5,
}
ccui.TextType = {
SYSTEM = 0,
TTF = 1,
}

View File

@ -270,7 +270,7 @@ function TestAsynchronousLoading:onEnter()
end
function TestAsynchronousLoading.restartCallback()
ccs.ArmatureDataManager:destoryInstance()
ccs.ArmatureDataManager:destroyInstance()
local newScene = ArmatureTestScene.create()
newScene:addChild(restartArmatureTest())
cc.Director:getInstance():replaceScene(newScene)

View File

@ -1982,7 +1982,7 @@ function UIPanelLayoutLinearVerticalTest:initExtend()
local background = root:getChildByName("background_Panel")
local layout = ccui.Layout:create()
layout:setLayoutType(ccui.Type.VERTICAL)
layout:setLayoutType(ccui.LayoutType.VERTICAL)
layout:setSize(cc.size(280, 150))
local backgroundSize = background:getContentSize()
layout:setPosition(cc.p((widgetSize.width - backgroundSize.width) / 2 +
@ -2065,7 +2065,7 @@ function UIPanelLayoutLinearHorizontalTest:initExtend()
local background = root:getChildByName("background_Panel")
local layout = ccui.Layout:create()
layout:setLayoutType(ccui.Type.HORIZONTAL)
layout:setLayoutType(ccui.LayoutType.HORIZONTAL)
layout:setClippingEnabled(true)
layout:setSize(cc.size(280, 150))
local backgroundSize = background:getContentSize()