Hi,
I want to apply filter DropShadow for the text in the button . Using the method filter
for that , applied dropshadow for the button, not for the text
For example, if I have a button with name testButton
this:
var testButton= new Button();
testButton.width = 120;
testButton.height = 50;
testButton.text = "Test button";
var dropShadowFilter = new DropShadow();
dropShadowFilter.distance = 20;
dropShadowFilter.angle = 45;
dropShadowFilter.color = 0x04f004;
dropShadowFilter.alpha = 0.5;
dropShadowFilter.blurX = 6;
dropShadowFilter.blurY = 1;
dropShadowFilter.strength = 300;
dropShadowFilter.quality = 35;
dropShadowFilter.inner = false;
testButton.customStyle.filter.push(dropShadowFilter);
will applied filter on the button, not for the text “Test button”
Second question is it possible to add button directly to the screen without using VBox / HBox …
Because this Screen.instance.addComponent(testButton);
won’t show background image , if the background image is load after that adding ( using VBox works)
At example:
button = new Button();
button.text = "Test button";
Assets.loadBitmapData("img/base.png").onComplete(imageLoaded);
// vbox.addComponent(button);
Screen.instance.addComponent(button);
private function imageLoaded( bitmapData:BitmapData ):Void
{
testButton.customStyle = {
backgroundColor: -1,
borderTopSize: 0,
borderLeftSize: 0,
borderBottomSize: 0,
borderRightSize: 0,
backgroundImageSliceTop: 58,
backgroundImageSliceLeft: 75,
backgroundImageSliceBottom: 110,
backgroundImageSliceRight: 400,
backgroundImage: bitmapData,
color: 0xffffff,
cursor: "pointer"
}
{
}