mirror of https://github.com/axmolengine/axmol.git
Update some GuiConstants and resubmission pr#6361.
This commit is contained in:
parent
95dfbf7dae
commit
cde4e4811b
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
static int tolua_cocos2d_MenuItemImage_create(lua_State* tolua_S)
|
static int tolua_cocos2d_MenuItemImage_create(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
if (NULL == tolua_S)
|
if (nullptr == tolua_S)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -58,47 +58,51 @@ static int tolua_cocos2d_MenuItemImage_create(lua_State* tolua_S)
|
||||||
}
|
}
|
||||||
} while (0);
|
} while (0);
|
||||||
do {
|
do {
|
||||||
|
if (argc == 2)
|
||||||
|
{
|
||||||
#if COCOS2D_DEBUG >= 1
|
#if COCOS2D_DEBUG >= 1
|
||||||
if (!tolua_isstring(tolua_S,2,0,&tolua_err) ||
|
if (!tolua_isstring(tolua_S,2,0,&tolua_err) ||
|
||||||
!tolua_isstring(tolua_S,3,0,&tolua_err))
|
!tolua_isstring(tolua_S,3,0,&tolua_err))
|
||||||
{
|
{
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
ok = true;
|
ok = true;
|
||||||
break;
|
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);
|
} while (0);
|
||||||
do {
|
do {
|
||||||
#if COCOS2D_DEBUG >= 1
|
if (argc == 3)
|
||||||
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;
|
#if COCOS2D_DEBUG >= 1
|
||||||
break;
|
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
|
#endif
|
||||||
const std::string normalImage = ((const std::string) tolua_tocppstring(tolua_S,2,0));
|
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 selectedImage = ((const std::string) tolua_tocppstring(tolua_S,3,0));
|
||||||
const std::string disabledImage = ((const std::string) tolua_tocppstring(tolua_S,4,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;
|
|
||||||
|
|
||||||
|
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);
|
} while (0);
|
||||||
|
|
||||||
CCLOG("'create' has wrong number of arguments: %d, was expecting %d\n", argc, 0);
|
CCLOG("'create' has wrong number of arguments: %d, was expecting %d\n", argc, 0);
|
||||||
|
|
|
@ -487,9 +487,8 @@ ccui.LoadingBarType = ccui.LoadingBarDirection
|
||||||
ccui.LoadingBarType.left = ccui.LoadingBarDirection.LEFT
|
ccui.LoadingBarType.left = ccui.LoadingBarDirection.LEFT
|
||||||
ccui.LoadingBarType.right = ccui.LoadingBarDirection.RIGHT
|
ccui.LoadingBarType.right = ccui.LoadingBarDirection.RIGHT
|
||||||
|
|
||||||
ccui.LayoutType = ccui.Type
|
ccui.LayoutType.absolute = ccui.LayoutType.ABSOLUTE
|
||||||
ccui.LayoutType.absolute = ccui.Type.ABSOLUTE
|
ccui.LayoutType.linearVertical = ccui.LayoutType.VERTICAL
|
||||||
ccui.LayoutType.linearVertical = ccui.Type.VERTICAL
|
ccui.LayoutType.linearHorizontal = ccui.LayoutType.HORIZONTAL
|
||||||
ccui.LayoutType.linearHorizontal = ccui.Type.HORIZONTAL
|
ccui.LayoutType.relative = ccui.LayoutType.RELATIVE
|
||||||
ccui.LayoutType.relative = ccui.Type.RELATIVE
|
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ ccui.LayoutBackGroundColorType =
|
||||||
gradient = 2,
|
gradient = 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
ccui.Type =
|
ccui.LayoutType =
|
||||||
{
|
{
|
||||||
ABSOLUTE = 0,
|
ABSOLUTE = 0,
|
||||||
VERTICAL = 1,
|
VERTICAL = 1,
|
||||||
|
@ -171,3 +171,8 @@ ccui.ListViewGravity = {
|
||||||
bottom = 4 ,
|
bottom = 4 ,
|
||||||
centerVertical = 5,
|
centerVertical = 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ccui.TextType = {
|
||||||
|
SYSTEM = 0,
|
||||||
|
TTF = 1,
|
||||||
|
}
|
||||||
|
|
|
@ -270,7 +270,7 @@ function TestAsynchronousLoading:onEnter()
|
||||||
end
|
end
|
||||||
|
|
||||||
function TestAsynchronousLoading.restartCallback()
|
function TestAsynchronousLoading.restartCallback()
|
||||||
ccs.ArmatureDataManager:destoryInstance()
|
ccs.ArmatureDataManager:destroyInstance()
|
||||||
local newScene = ArmatureTestScene.create()
|
local newScene = ArmatureTestScene.create()
|
||||||
newScene:addChild(restartArmatureTest())
|
newScene:addChild(restartArmatureTest())
|
||||||
cc.Director:getInstance():replaceScene(newScene)
|
cc.Director:getInstance():replaceScene(newScene)
|
||||||
|
|
|
@ -1982,7 +1982,7 @@ function UIPanelLayoutLinearVerticalTest:initExtend()
|
||||||
local background = root:getChildByName("background_Panel")
|
local background = root:getChildByName("background_Panel")
|
||||||
|
|
||||||
local layout = ccui.Layout:create()
|
local layout = ccui.Layout:create()
|
||||||
layout:setLayoutType(ccui.Type.VERTICAL)
|
layout:setLayoutType(ccui.LayoutType.VERTICAL)
|
||||||
layout:setSize(cc.size(280, 150))
|
layout:setSize(cc.size(280, 150))
|
||||||
local backgroundSize = background:getContentSize()
|
local backgroundSize = background:getContentSize()
|
||||||
layout:setPosition(cc.p((widgetSize.width - backgroundSize.width) / 2 +
|
layout:setPosition(cc.p((widgetSize.width - backgroundSize.width) / 2 +
|
||||||
|
@ -2065,7 +2065,7 @@ function UIPanelLayoutLinearHorizontalTest:initExtend()
|
||||||
local background = root:getChildByName("background_Panel")
|
local background = root:getChildByName("background_Panel")
|
||||||
|
|
||||||
local layout = ccui.Layout:create()
|
local layout = ccui.Layout:create()
|
||||||
layout:setLayoutType(ccui.Type.HORIZONTAL)
|
layout:setLayoutType(ccui.LayoutType.HORIZONTAL)
|
||||||
layout:setClippingEnabled(true)
|
layout:setClippingEnabled(true)
|
||||||
layout:setSize(cc.size(280, 150))
|
layout:setSize(cc.size(280, 150))
|
||||||
local backgroundSize = background:getContentSize()
|
local backgroundSize = background:getContentSize()
|
||||||
|
|
Loading…
Reference in New Issue