Label objects on screen, you can create some effects such as a drop shadow and an outline on them easily without having your own custom class. The
Label class can be used for applying the effects to these objects. However, note that not all label types support all effects.
Here's how to create
Label with a drop shadow effect:
auto layer = LayerColor::create(Color4B::GRAY); this->addChild(layer); auto label = Label::createWithTTF("Drop Shadow", "fonts/Marker Felt.ttf", 40); label->setPosition(size/2); this->addChild(label); // shadow effect label->enableShadow();
Here's how to create ...