mirror of https://github.com/axmolengine/axmol.git
Replace cc.LabelBMFont:create with cc.Label:createBMFont
This commit is contained in:
parent
c69d9e75b2
commit
9713a246ee
|
@ -37,12 +37,12 @@ local function showFont(ret, pFont)
|
|||
ret:removeChildByTag(kTagLabel3, true)
|
||||
ret:removeChildByTag(kTagLabel4, true)
|
||||
|
||||
local top = cc.LabelTTF:create(pFont, pFont, 24)
|
||||
local left = cc.LabelTTF:create("alignment left", pFont, fontSize,
|
||||
local top = cc.Label:create(pFont, pFont, 24)
|
||||
local left = cc.Label:create("alignment left", pFont, fontSize,
|
||||
blockSize, cc.TEXT_ALIGNMENT_LEFT, verticalAlignment[vAlignIdx])
|
||||
local center = cc.LabelTTF:create("alignment center", pFont, fontSize,
|
||||
local center = cc.Label:create("alignment center", pFont, fontSize,
|
||||
blockSize, cc.TEXT_ALIGNMENT_CENTER, verticalAlignment[vAlignIdx])
|
||||
local right = cc.LabelTTF:create("alignment right", pFont, fontSize,
|
||||
local right = cc.Label:create("alignment right", pFont, fontSize,
|
||||
blockSize, cc.TEXT_ALIGNMENT_RIGHT, verticalAlignment[vAlignIdx])
|
||||
|
||||
local leftColor = cc.LayerColor:create(cc.c4b(100, 100, 100, 255), blockSize.width, blockSize.height)
|
||||
|
|
|
@ -23,11 +23,16 @@ local function IntervalLayer()
|
|||
ret:addChild(sun)
|
||||
|
||||
-- timers
|
||||
m_label0 = cc.LabelBMFont:create("0", "fonts/bitmapFontTest4.fnt")
|
||||
m_label1 = cc.LabelBMFont:create("0", "fonts/bitmapFontTest4.fnt")
|
||||
m_label2 = cc.LabelBMFont:create("0", "fonts/bitmapFontTest4.fnt")
|
||||
m_label3 = cc.LabelBMFont:create("0", "fonts/bitmapFontTest4.fnt")
|
||||
m_label4 = cc.LabelBMFont:create("0", "fonts/bitmapFontTest4.fnt")
|
||||
m_label0 = cc.Label:createWithBMFont("fonts/bitmapFontTest4.fnt", "0")
|
||||
m_label0:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
m_label1 = cc.Label:createWithBMFont("fonts/bitmapFontTest4.fnt", "0")
|
||||
m_label1:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
m_label2 = cc.Label:createWithBMFont("fonts/bitmapFontTest4.fnt", "0")
|
||||
m_label2:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
m_label3 = cc.Label:createWithBMFont("fonts/bitmapFontTest4.fnt", "0")
|
||||
m_label3:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
m_label4 = cc.Label:createWithBMFont("fonts/bitmapFontTest4.fnt", "0")
|
||||
m_label4:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
|
||||
local function update(dt)
|
||||
m_time0 = m_time0 + dt
|
||||
|
|
|
@ -68,7 +68,8 @@ local function LayerTestCascadingOpacityA()
|
|||
|
||||
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
||||
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
||||
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
||||
local label = cc.Label:createWithBMFont("fonts/bitmapFontTest.fnt", "Test")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
|
||||
layer1:addChild(sister1)
|
||||
layer1:addChild(sister2)
|
||||
|
@ -109,7 +110,8 @@ local function LayerTestCascadingOpacityB()
|
|||
|
||||
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
||||
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
||||
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
||||
local label = cc.Label:createWithBMFont("fonts/bitmapFontTest.fnt","Test")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
|
||||
layer1:addChild(sister1)
|
||||
layer1:addChild(sister2)
|
||||
|
@ -142,7 +144,8 @@ local function LayerTestCascadingOpacityC()
|
|||
|
||||
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
||||
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
||||
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
||||
local label = cc.Label:createWithBMFont("fonts/bitmapFontTest.fnt","Test")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
|
||||
layer1:addChild(sister1)
|
||||
layer1:addChild(sister2)
|
||||
|
@ -172,7 +175,8 @@ local function LayerTestCascadingColorA()
|
|||
|
||||
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
||||
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
||||
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
||||
local label = cc.Label:createWithBMFont("fonts/bitmapFontTest.fnt","Test")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
|
||||
layer1:addChild(sister1)
|
||||
layer1:addChild(sister2)
|
||||
|
@ -218,7 +222,8 @@ local function LayerTestCascadingColorB()
|
|||
|
||||
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
||||
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
||||
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
||||
local label = cc.Label:createWithBMFont("fonts/bitmapFontTest.fnt","Test")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
|
||||
layer1:addChild(sister1)
|
||||
layer1:addChild(sister2)
|
||||
|
@ -263,7 +268,8 @@ local function LayerTestCascadingColorC()
|
|||
|
||||
local sister1 = cc.Sprite:create("Images/grossinis_sister1.png")
|
||||
local sister2 = cc.Sprite:create("Images/grossinis_sister2.png")
|
||||
local label = cc.LabelBMFont:create("Test", "fonts/bitmapFontTest.fnt")
|
||||
local label = cc.Label:createWithBMFont("fonts/bitmapFontTest.fnt","Test")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
|
||||
layer1:addChild(sister1)
|
||||
layer1:addChild(sister2)
|
||||
|
|
|
@ -89,7 +89,8 @@ local function MenuLayerMainMenu()
|
|||
end
|
||||
|
||||
-- Label Item (cc.LabelBMFont)
|
||||
local label = cc.LabelBMFont:create("configuration", "fonts/bitmapFontTest3.fnt")
|
||||
local label = cc.Label:createWithBMFont("fonts/bitmapFontTest3.fnt", "configuration")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
local item5 = cc.MenuItemLabel:create(label)
|
||||
item5:registerScriptTapHandler(menuCallbackConfig)
|
||||
|
||||
|
@ -321,7 +322,8 @@ local function MenuLayer3()
|
|||
cc.MenuItemFont:setFontName("Marker Felt")
|
||||
cc.MenuItemFont:setFontSize(28)
|
||||
|
||||
local label = cc.LabelBMFont:create("Enable AtlasItem", "fonts/bitmapFontTest3.fnt")
|
||||
local label = cc.Label:createWithBMFont("fonts/bitmapFontTest3.fnt", "Enable AtlasItem")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
local item1 = cc.MenuItemLabel:create(label)
|
||||
item1:registerScriptTapHandler(menuCallback2)
|
||||
|
||||
|
@ -446,7 +448,8 @@ local function MenuLayer4()
|
|||
cc.MenuItemFont:setFontName( "Marker Felt" )
|
||||
cc.MenuItemFont:setFontSize( 34 )
|
||||
|
||||
local label = cc.LabelBMFont:create( "go back", "fonts/bitmapFontTest3.fnt" )
|
||||
local label = cc.Label:createWithBMFont("fonts/bitmapFontTest3.fnt", "go back")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
local back = cc.MenuItemLabel:create(label)
|
||||
back:registerScriptTapHandler(backCallback)
|
||||
|
||||
|
|
|
@ -166,7 +166,8 @@ local function OpenGLTestMainLayer()
|
|||
program:link()
|
||||
program:updateUniforms()
|
||||
|
||||
label = cc.LabelBMFont:create("RETRO EFFECT","fonts/west_england-64.fnt")
|
||||
label = cc.Label:createWithBMFont("fonts/west_england-64.fnt", "RETRO EFFECT")
|
||||
label:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
label:setShaderProgram( program )
|
||||
|
||||
label:setPosition(size.width/2, size.height/2)
|
||||
|
|
|
@ -1613,7 +1613,8 @@ local function runTouchesTest()
|
|||
|
||||
pLayer:scheduleUpdateWithPriorityLua(update,0)
|
||||
|
||||
pClassLabel = cc.LabelBMFont:create("00.0", "fonts/arial16.fnt")
|
||||
pClassLabel = cc.Label:createWithBMFont("fonts/arial16.fnt", "00.0")
|
||||
pClassLabel:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
pClassLabel:setPosition(cc.p(s.width/2, s.height/2))
|
||||
pLayer:addChild(pClassLabel)
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ local function XMLHttpRequestLayer()
|
|||
labelStatusCode:setString("waiting...")
|
||||
end
|
||||
|
||||
local labelPostJson = cc.LabelTTF:create("Test Post Json", s_arialPath, 22)
|
||||
local labelPostJson = cc.Label:create("Test Post Json", s_arialPath, 22)
|
||||
labelPostJson:setAnchorPoint(cc.p(0.5, 0.5))
|
||||
local itemPostJson = cc.MenuItemLabel:create(labelPostJson)
|
||||
itemPostJson:registerScriptTapHandler(onMenuPostJsonClicked)
|
||||
|
|
Loading…
Reference in New Issue