|
|
@@ -35,18 +35,15 @@ using namespace Polycode;
|
|
|
|
|
|
ScreenLabel::ScreenLabel(const String& text, int size, const String& fontName, int amode, bool premultiplyAlpha) : ScreenShape(ScreenShape::SHAPE_RECT,1,1) {
|
|
|
label = new Label(CoreServices::getInstance()->getFontManager()->getFontByName(fontName), text, size, amode, premultiplyAlpha);
|
|
|
- dropShadowImage = NULL;
|
|
|
texture = NULL;
|
|
|
updateTexture();
|
|
|
- positionMode = POSITION_TOPLEFT;
|
|
|
- dropShadowImage = NULL;
|
|
|
+ positionMode = POSITION_TOPLEFT;
|
|
|
colorAffectsChildren = false;
|
|
|
positionAtBaseline = true;
|
|
|
}
|
|
|
|
|
|
ScreenLabel::~ScreenLabel() {
|
|
|
delete label;
|
|
|
- delete dropShadowImage;
|
|
|
}
|
|
|
|
|
|
Label *ScreenLabel::getLabel() const {
|
|
|
@@ -65,19 +62,6 @@ void ScreenLabel::applyClone(Entity *clone, bool deepClone, bool ignoreEditorOnl
|
|
|
_clone->positionAtBaseline = positionAtBaseline;
|
|
|
}
|
|
|
|
|
|
-void ScreenLabel::addDropShadow(Color color, Number size, Number offsetX, Number offsetY) {
|
|
|
- delete dropShadowImage;
|
|
|
- Image *labelImage = new Image(label);
|
|
|
- labelImage->fastBlur(size);
|
|
|
- dropShadowImage = new ScreenImage(labelImage);
|
|
|
- delete labelImage;
|
|
|
- addChild(dropShadowImage);
|
|
|
- dropShadowImage->setColor(color);
|
|
|
- dropShadowImage->setPositionMode(POSITION_TOPLEFT);
|
|
|
- dropShadowImage->setPosition(offsetX, offsetY);
|
|
|
- dropShadowImage->getMesh()->getPolygon(0)->flipUVY();
|
|
|
-}
|
|
|
-
|
|
|
const String& ScreenLabel::getText() const {
|
|
|
return label->getText();
|
|
|
}
|