mirror of https://github.com/axmolengine/axmol.git
Merge pull request #19815 from PatriceJiang/ccEditBox_to_ccuiEditBox
[lua-tests] replace cc.EditBox with ccui.EditBox
This commit is contained in:
commit
0d2b40b6ec
|
@ -87,7 +87,7 @@ local function runEditBoxTest()
|
|||
end
|
||||
end
|
||||
-- top
|
||||
EditName = cc.EditBox:create(editBoxSize, cc.Scale9Sprite:create("extensions/green_edit.png"))
|
||||
EditName = ccui.EditBox:create(editBoxSize, ccui.Scale9Sprite:create("extensions/green_edit.png"))
|
||||
EditName:setPosition(cc.p(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height*3/4))
|
||||
local targetPlatform = cc.Application:getInstance():getTargetPlatform()
|
||||
if kTargetIphone == targetPlatform or kTargetIpad == targetPlatform then
|
||||
|
@ -106,7 +106,7 @@ local function runEditBoxTest()
|
|||
newLayer:addChild(EditName)
|
||||
|
||||
--middle
|
||||
EditPassword = cc.EditBox:create(editBoxSize, cc.Scale9Sprite:create("extensions/orange_edit.png"))
|
||||
EditPassword = ccui.EditBox:create(editBoxSize, ccui.Scale9Sprite:create("extensions/orange_edit.png"))
|
||||
EditPassword:setPosition(cc.p(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/2))
|
||||
if kTargetIphone == targetPlatform or kTargetIpad == targetPlatform then
|
||||
EditPassword:setFont("American Typewriter", 30)
|
||||
|
@ -124,7 +124,7 @@ local function runEditBoxTest()
|
|||
newLayer:addChild(EditPassword)
|
||||
|
||||
--bottom
|
||||
EditEmail = cc.EditBox:create(cc.size(editBoxSize.width, editBoxSize.height), cc.Scale9Sprite:create("extensions/yellow_edit.png"))
|
||||
EditEmail = ccui.EditBox:create(cc.size(editBoxSize.width, editBoxSize.height), ccui.Scale9Sprite:create("extensions/yellow_edit.png"))
|
||||
EditEmail:setPosition(cc.p(visibleOrigin.x+visibleSize.width/2, visibleOrigin.y+visibleSize.height/4))
|
||||
EditEmail:setAnchorPoint(cc.p(0.5, 1.0))
|
||||
EditEmail:setPlaceHolder("Email:")
|
||||
|
|
|
@ -10,7 +10,7 @@ function TextInput.create()
|
|||
local res = "Images/CyanSquare.png"
|
||||
local width = 200
|
||||
local height = 40
|
||||
local back = cc.Scale9Sprite:create(res)
|
||||
local back = ccui.Scale9Sprite:create(res)
|
||||
local edit = ccui.EditBox:create(cc.size(width,height),res)
|
||||
layer:addChild(edit)
|
||||
edit:setPosition( cc.p(250,200) )
|
||||
|
|
Loading…
Reference in New Issue