85 auto s = Director::getInstance()->getWinSize();
87 auto blockSize = Size(s.width/3, 200);
98 auto top = Label::createWithSystemFont(fontFile, fontFile, 24);
99 auto left = Label::createWithSystemFont(
"alignment left", fontFile, fontSize,
101 auto center = Label::createWithSystemFont(
"alignment center", fontFile, fontSize,
103 auto right = Label::createWithSystemFont(
"alignment right", fontFile, fontSize,
106 auto leftColor = LayerColor::create(Color4B(100, 100, 100, 255), blockSize.width, blockSize.height);
107 auto centerColor = LayerColor::create(Color4B(200, 100, 100, 255), blockSize.width, blockSize.height);
108 auto rightColor = LayerColor::create(Color4B(100, 100, 200, 255), blockSize.width, blockSize.height);
110 leftColor->setIgnoreAnchorPointForPosition(
false);
111 centerColor->setIgnoreAnchorPointForPosition(
false);
112 rightColor->setIgnoreAnchorPointForPosition(
false);
115 top->setAnchorPoint(Vec2(0.5, 1));
116 left->setAnchorPoint(Vec2(0,0.5));
117 leftColor->setAnchorPoint(Vec2(0,0.5));
118 center->setAnchorPoint(Vec2(0,0.5));
119 centerColor->setAnchorPoint(Vec2(0,0.5));
120 right->setAnchorPoint(Vec2(0,0.5));
121 rightColor->setAnchorPoint(Vec2(0,0.5));
123 top->setPosition(s.width/2,s.height-20);
124 left->setPosition(0,s.height/2);
125 leftColor->setPosition(left->getPosition());
126 center->setPosition(blockSize.width, s.height/2);
127 centerColor->setPosition(center->getPosition());
128 right->setPosition(blockSize.width*2, s.height/2);
129 rightColor->setPosition(right->getPosition());
static TextVAlignment verticalAlignment[]