cocostudio 實現換行功能的label (文本區) lua

關鍵字:實現換行功能的label (文本區)
代碼類庫:文本輸入(Textfield)
lua

-- 建立實現換行功能的文本 
function LoadLabelHeroIntroduce(objLabelContent) 
--------------------------------- 
    local tLabel = LG.Label:create() 
--  實現換行功能 
    tLabel:ignoreContentAdaptWithSize(false)  
    tLabel:setText(objLabelContent) 
    local tSize = tLabel:getContentSize() 
    local tmp_width = tSize.width 
    local end_height = (tmp_width / 180 +1)* (tSize.height) 
    tLabel:setSize(Global_CCSize(180,end_height)) 
    return tLabel 
--------------------------------- 
end
相關文章
相關標籤/搜索