86 Size widgetSize =
_widget->getContentSize();
89 Text* alert = Text::create(
"TextAtlas With ETC1 format",
"fonts/Marker Felt.ttf",30);
90 alert->setColor(Color3B(159, 168, 176));
91 alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getContentSize().height * 1.75f));
95 TextAtlas* textAtlas =
nullptr;
96 if (Director::getInstance()->getWinSizeInPixels().height > 320.f)
98 textAtlas = TextAtlas::create(
"1234567890",
"cocosui/labelatlas.pkm", 34, 44,
"0");
102 textAtlas = TextAtlas::create(
"1234567890",
"cocosui/labelatlas.pkm", 17, 22,
"0");
104 textAtlas->setPosition(Vec2((widgetSize.width) / 2, widgetSize.height / 2.0f));
106 auto labelAtlas = (Label*)textAtlas->getVirtualRenderer();
107 labelAtlas->enableShadow(Color4B::GREEN);
110 TTFConfig ttfConfig(
"fonts/arial.ttf", 15);
111 auto label1 = Label::createWithTTF(ttfConfig,
"Print Resources");
114 auto pMenu1 = Menu::create(item1,
nullptr);
115 pMenu1->setPosition(Vec2(0, 0));
116 this->addChild(pMenu1, 10);
cocos2d::Layer * _uiLayer
virtual bool init() override
cocos2d::ui::Layout * _widget
void printWidgetResources(cocos2d::Ref *sender)
cocos2d::ui::TextAtlas * _textAtlas
static cocos2d::Vec2 bottom()
static cocos2d::Vec2 left()