mirror of https://github.com/axmolengine/axmol.git
Fixed crash of sample
This commit is contained in:
parent
8b9d572961
commit
7415ecc2b7
|
@ -77,6 +77,7 @@ static const char* s_testArray[] =
|
||||||
"UITextFieldTest",
|
"UITextFieldTest",
|
||||||
"UITextFieldTest_MaxLength",
|
"UITextFieldTest_MaxLength",
|
||||||
"UITextFieldTest_Password",
|
"UITextFieldTest_Password",
|
||||||
|
"UITextFieldTest_LineWrap",
|
||||||
"UILayoutTest",
|
"UILayoutTest",
|
||||||
"UILayoutTest_Color",
|
"UILayoutTest_Color",
|
||||||
"UILayoutTest_Gradient",
|
"UILayoutTest_Gradient",
|
||||||
|
|
|
@ -18,25 +18,25 @@ bool UIWidgetAddNodeTest::init()
|
||||||
{
|
{
|
||||||
if (UIScene::init())
|
if (UIScene::init())
|
||||||
{
|
{
|
||||||
// Size widgetSize = _widget->getSize();
|
Size widgetSize = _widget->getSize();
|
||||||
//
|
|
||||||
// // Add the alert
|
// Add the alert
|
||||||
// Text* alert = Text::create();
|
Text* alert = Text::create();
|
||||||
// alert->setText("Widget Add Node");
|
alert->setText("Widget Add Node");
|
||||||
// alert->setFontName("Marker Felt");
|
alert->setFontName("Marker Felt");
|
||||||
// alert->setFontSize(30);
|
alert->setFontSize(30);
|
||||||
// alert->setColor(Color3B(159, 168, 176));
|
alert->setColor(Color3B(159, 168, 176));
|
||||||
// alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75));
|
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75));
|
||||||
// _uiLayer->addChild(alert);
|
_uiLayer->addChild(alert);
|
||||||
//
|
|
||||||
// // Create the ui node container
|
// Create the ui node container
|
||||||
// Widget* widget = Widget::create();
|
Widget* widget = Widget::create();
|
||||||
// widget->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
|
widget->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
|
||||||
// _uiLayer->addChild(widget);
|
_uiLayer->addChild(widget);
|
||||||
//
|
|
||||||
// Sprite* sprite = Sprite::create("cocosgui/ccicon.png");
|
Sprite* sprite = Sprite::create("cocosgui/ccicon.png");
|
||||||
// sprite->setPosition(Point(0, sprite->getBoundingBox().size.height / 4));
|
sprite->setPosition(Point(0, sprite->getBoundingBox().size.height / 4));
|
||||||
// widget->addNode(sprite);
|
widget->addNode(sprite);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue