mirror of https://github.com/axmolengine/axmol.git
Fix the crash that CocoStudioGuiTest in the Linux platform and errors than Sprite3DTest
This commit is contained in:
parent
cf5f14ab51
commit
ace0d05bd4
|
@ -1,5 +1,6 @@
|
|||
local guiSceneManager = {}
|
||||
guiSceneManager.currentUISceneIdx = 1
|
||||
local font_TextName = "fonts/Marker Felt.ttf"
|
||||
|
||||
local UIScene = class("UIScene")
|
||||
UIScene.__index = UIScene
|
||||
|
@ -106,7 +107,7 @@ function UIButtonTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UIButtonTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -114,7 +115,7 @@ function UIButtonTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Button")
|
||||
alert:setFontName(font_UIButtonTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
|
||||
|
@ -170,7 +171,7 @@ function UIButtonScale9Test:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UIButtonTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -178,7 +179,7 @@ function UIButtonScale9Test:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Button scale9 render")
|
||||
alert:setFontName(font_UIButtonTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -236,7 +237,7 @@ function UIButtonPressedActionTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UIButtonTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -244,7 +245,7 @@ function UIButtonPressedActionTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Button Pressed Action")
|
||||
alert:setFontName(font_UIButtonTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -301,7 +302,7 @@ function UITextButtonTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UIButtonTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -309,7 +310,7 @@ function UITextButtonTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("TextButton")
|
||||
alert:setFontName(font_UIButtonTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -365,7 +366,7 @@ function UITextButtonScale9Test:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UIButtonTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -373,7 +374,7 @@ function UITextButtonScale9Test:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("TextButton scale9 render")
|
||||
alert:setFontName(font_UIButtonTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -431,7 +432,7 @@ function UICheckBoxTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UIButtonTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -439,7 +440,7 @@ function UICheckBoxTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("CheckBox")
|
||||
alert:setFontName(font_UICheckBoxTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -496,7 +497,7 @@ function UISliderTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("Move the slider thumb")
|
||||
self._displayValueLabel:setFontName(font_UISliderTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -504,7 +505,7 @@ function UISliderTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Slider")
|
||||
alert:setFontName(font_UISliderTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -558,7 +559,7 @@ function UISliderScale9Test:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("Move the slider thumb")
|
||||
self._displayValueLabel:setFontName(font_UISliderTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -566,7 +567,7 @@ function UISliderScale9Test:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Slider scale9 render")
|
||||
alert:setFontName(font_UISliderTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -622,7 +623,7 @@ function UIImageViewTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("ImageView")
|
||||
alert:setFontName(font_UIImageViewTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -663,7 +664,7 @@ function UIImageViewScale9Test:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("ImageView scale9 render")
|
||||
alert:setFontName(font_UIImageViewTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -716,7 +717,7 @@ function UILoadingBarLeftTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("LoadingBar")
|
||||
alert:setFontName(font_UILoadingBarTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -842,7 +843,7 @@ function UILoadingBarRightTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("LoadingBar")
|
||||
alert:setFontName(font_UILoadingBarTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -969,7 +970,7 @@ function UILoadingBarLeftScale9Test:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("LoadingBar Scale9 Render")
|
||||
alert:setFontName(font_UILoadingBarTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1098,7 +1099,7 @@ function UILoadingBarRightScale9Test:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("LoadingBar Scale9 Render")
|
||||
alert:setFontName(font_UILoadingBarTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1216,7 +1217,7 @@ function UILabelAtlasTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("LabelAtlas")
|
||||
alert:setFontName(font_UILabelAtlasTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1257,7 +1258,7 @@ function UILabelBMFontTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("LabelBMFont")
|
||||
alert:setFontName(font_UILabelBMFontTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1299,7 +1300,7 @@ function UILabelTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Label")
|
||||
alert:setFontName(font_UILabelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1340,7 +1341,7 @@ function UITextAreaTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("TextArea")
|
||||
alert:setFontName(font_UITextAreaTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1384,7 +1385,7 @@ function UITextFieldTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UITextFieldTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -1392,7 +1393,7 @@ function UITextFieldTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("TextField")
|
||||
alert:setFontName(font_UITextFieldTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1418,7 +1419,7 @@ function UITextFieldTest:initExtend()
|
|||
|
||||
local textField = ccui.TextField:create()
|
||||
textField:setTouchEnabled(true)
|
||||
textField:setFontName(font_UITextFieldTest)
|
||||
textField:setFontName(font_TextName)
|
||||
textField:setFontSize(30)
|
||||
textField:setPlaceHolder("input words here")
|
||||
textField:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -1454,7 +1455,7 @@ function UITextFieldMaxLengthTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UITextFieldTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -1462,7 +1463,7 @@ function UITextFieldMaxLengthTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("TextField max length")
|
||||
alert:setFontName(font_UITextFieldTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1496,7 +1497,7 @@ function UITextFieldMaxLengthTest:initExtend()
|
|||
textField:setMaxLengthEnabled(true)
|
||||
textField:setMaxLength(3)
|
||||
textField:setTouchEnabled(true)
|
||||
textField:setFontName(font_UITextFieldTest)
|
||||
textField:setFontName(font_TextName)
|
||||
textField:setFontSize(30)
|
||||
textField:setPlaceHolder("input words here")
|
||||
textField:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -1532,7 +1533,7 @@ function UITextFieldPasswordTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UITextFieldTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -1540,7 +1541,7 @@ function UITextFieldPasswordTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("TextField password")
|
||||
alert:setFontName(font_UITextFieldTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1568,7 +1569,7 @@ function UITextFieldPasswordTest:initExtend()
|
|||
textField:setPasswordEnabled(true)
|
||||
textField:setPasswordStyleText("*")
|
||||
textField:setTouchEnabled(true)
|
||||
textField:setFontName(font_UITextFieldTest)
|
||||
textField:setFontName(font_TextName)
|
||||
textField:setFontSize(30)
|
||||
textField:setPlaceHolder("input password here")
|
||||
textField:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0))
|
||||
|
@ -1604,7 +1605,7 @@ function UIPanelTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Panel")
|
||||
alert:setFontName(font_UIPanelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -1672,7 +1673,7 @@ function UIPanelColorTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Panel color render")
|
||||
alert:setFontName(font_UIPanelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -1742,7 +1743,7 @@ function UIPanelGradientTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Panel color Gradient")
|
||||
alert:setFontName(font_UIPanelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -1812,7 +1813,7 @@ function UIPanelBackGroundImageTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Panel background image")
|
||||
alert:setFontName(font_UIPanelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -1882,7 +1883,7 @@ function UIPanelBackGroundImageScale9Test:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Panel background image scale9")
|
||||
alert:setFontName(font_UIPanelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -1952,7 +1953,7 @@ function UIPanelLayoutLinearVerticalTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Panel Layout Linear Vertical")
|
||||
alert:setFontName(font_UIPanelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -2035,7 +2036,7 @@ function UIPanelLayoutLinearHorizontalTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("Panel Layout Linear Horizontal")
|
||||
alert:setFontName(font_UIPanelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -2120,7 +2121,7 @@ function UIScrollViewVerticalTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("Move by vertical direction")
|
||||
self._displayValueLabel:setFontName(font_UIScrollViewTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -2128,7 +2129,7 @@ function UIScrollViewVerticalTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("ScrollView")
|
||||
alert:setFontName(font_UIScrollViewTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -2209,7 +2210,7 @@ function UIScrollViewHorizontalTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("Move by horizontal direction")
|
||||
self._displayValueLabel:setFontName(font_UIScrollViewTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -2217,7 +2218,7 @@ function UIScrollViewHorizontalTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("ScrollView")
|
||||
alert:setFontName(font_UIScrollViewTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -2305,7 +2306,7 @@ function UIPageViewTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("Move by horizontal direction")
|
||||
self._displayValueLabel:setFontName(font_UIPageViewTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -2313,7 +2314,7 @@ function UIPageViewTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("PageView")
|
||||
alert:setFontName(font_UIPageViewTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -2346,7 +2347,7 @@ function UIPageViewTest:initExtend()
|
|||
local label = ccui.Text:create()
|
||||
local pageInfo = string.format("page %d", i)
|
||||
label:setString(pageInfo)
|
||||
label:setFontName(font_UIPageViewTest)
|
||||
label:setFontName(font_TextName)
|
||||
label:setFontSize(30)
|
||||
label:setColor(cc.c3b(192, 192, 192))
|
||||
label:setPosition(cc.p(layout:getContentSize().width / 2, layout:getContentSize().height / 2))
|
||||
|
@ -2399,7 +2400,7 @@ function UIListViewVerticalTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("Move by vertical direction")
|
||||
self._displayValueLabel:setFontName(font_UIListViewTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -2407,7 +2408,7 @@ function UIListViewVerticalTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("ListView")
|
||||
alert:setFontName(font_UIListViewTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -2567,7 +2568,7 @@ function UIListViewHorizontalTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("Move by vertical direction")
|
||||
self._displayValueLabel:setFontName(font_UIListViewTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -2575,7 +2576,7 @@ function UIListViewHorizontalTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("ListView")
|
||||
alert:setFontName(font_UIListViewTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -2723,7 +2724,7 @@ function UIDragPanelTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UIDragPanelTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -2731,7 +2732,7 @@ function UIDragPanelTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("DragPanel")
|
||||
alert:setFontName(font_UIDragPanelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -2782,7 +2783,7 @@ function UIDragPanelBounceTest:initExtend()
|
|||
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("No Event")
|
||||
self._displayValueLabel:setFontName(font_UIDragPanelTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -2791,7 +2792,7 @@ function UIDragPanelBounceTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("DragPanel Bounce")
|
||||
alert:setFontName(font_UIDragPanelTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 2.925))
|
||||
|
@ -2839,10 +2840,10 @@ function UINodeContainerTest:initExtend()
|
|||
self:init()
|
||||
|
||||
local widgetSize = self._widget:getContentSize()
|
||||
|
||||
print("setFontName before")
|
||||
self._displayValueLabel = ccui.Text:create()
|
||||
self._displayValueLabel:setString("NodeContainer Add CCNode")
|
||||
self._displayValueLabel:setFontName(font_UINodeContainerTest)
|
||||
self._displayValueLabel:setFontName(font_TextName)
|
||||
self._displayValueLabel:setFontSize(32)
|
||||
self._displayValueLabel:setAnchorPoint(cc.p(0.5, -1))
|
||||
self._displayValueLabel:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 + self._displayValueLabel:getContentSize().height * 1.5))
|
||||
|
@ -2850,7 +2851,7 @@ function UINodeContainerTest:initExtend()
|
|||
|
||||
local alert = ccui.Text:create()
|
||||
alert:setString("NodeContainer")
|
||||
alert:setFontName(font_UINodeContainerTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setFontSize(30)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 1.75))
|
||||
|
@ -2892,7 +2893,7 @@ function UIRichTextTest:initExtend()
|
|||
local widgetSize = self._widget:getContentSize()
|
||||
|
||||
local alert = ccui.Text:create("RichText", "fonts/Marker Felt.ttf", 30)
|
||||
alert:setFontName(font_UINodeContainerTest)
|
||||
alert:setFontName(font_TextName)
|
||||
alert:setColor(cc.c3b(159, 168, 176))
|
||||
alert:setPosition(cc.p(widgetSize.width / 2.0, widgetSize.height / 2.0 - alert:getContentSize().height * 3.125))
|
||||
self._widget:addChild(alert)
|
||||
|
|
|
@ -79,18 +79,27 @@ function Sprite3DWithSkinTest.addNewSpriteWithCoords(parent,x,y)
|
|||
sprite:setPosition(cc.p(x, y))
|
||||
parent:addChild(sprite)
|
||||
|
||||
local animation = cc.Animation3D:getOrCreate("Sprite3DTest/orc.c3b")
|
||||
local animation = cc.Animation3D:create("Sprite3DTest/orc.c3b")
|
||||
if nil ~= animation then
|
||||
local animate = cc.Animate3D:create(animation)
|
||||
if math.random() < (1/3) then
|
||||
animate:setPlayBack(true)
|
||||
local inverse = false
|
||||
if math.random() == 0 then
|
||||
inverse = true
|
||||
end
|
||||
|
||||
local rand2 = math.random()
|
||||
local speed = 1.0
|
||||
|
||||
if rand2 < 1/3 then
|
||||
animate:setSpeed(animate:getSpeed() + math.random())
|
||||
speed = animate:getSpeed() + math.random()
|
||||
elseif rand2 < 2/3 then
|
||||
animate:setSpeed(animate:getSpeed() - 0.5 * math.random())
|
||||
speed = animate:getSpeed() - 0.5 * math.random()
|
||||
end
|
||||
|
||||
if inverse then
|
||||
animate:setSpeed(-speed)
|
||||
else
|
||||
animate:setSpeed(speed)
|
||||
end
|
||||
|
||||
sprite:runAction(cc.RepeatForever:create(animate))
|
||||
|
@ -226,7 +235,7 @@ function Animate3DTest:addSprite3D()
|
|||
|
||||
self._sprite = sprite
|
||||
|
||||
local animation = cc.Animation3D:getOrCreate(fileName)
|
||||
local animation = cc.Animation3D:create(fileName)
|
||||
if nil ~= animation then
|
||||
local animate = cc.Animate3D:create(animation, 0.0, 1.933)
|
||||
sprite:runAction(cc.RepeatForever:create(animate))
|
||||
|
|
Loading…
Reference in New Issue