scale9Grid not working in html5

#1

Hello,

scale9Grid not work in html5

import openfl.display.Sprite;
import openfl.geom.Rectangle;

class Main extends Sprite
{
    public function new()
    {
        super();
        
        var cornerRadius:Int = 50;
        
        var size:Float = 100;
        var sprite:Sprite = new Sprite();
        sprite.graphics.beginFill(0x000000);
        sprite.graphics.drawRoundRect(0, 0, size, size, cornerRadius);
        sprite.graphics.endFill();
        
        sprite.scale9Grid = new Rectangle( cornerRadius / 2, cornerRadius / 2, size - cornerRadius, size - cornerRadius );
        this.addChild( sprite );
        
        sprite.width = 500;
    }
}

Thanks

0 Likes

#2

I know that this isn’t helpful but it doesn’t work because it simply isn’t implemented for the HTML5 target.

2 Likes