0

关于位图重复 x 和 y 的快速问题,我尝试了以下方法,但它不起作用

mySprite.graphics.beginBitmapFill(myFill);
mySprite.graphics.drawRect(-5, -5, 10, 10);
mySprite.graphics.endFill();

是不是因为你需要一个矩阵

public function beginBitmapFill(bitmap:BitmapData, matrix:Matrix = null, repeat:Boolean = true, smooth:Boolean = false):void

干杯比尔

4

1 回答 1

2
function drawBackground():void {
    var clip:MovieClip = new GradientMovieClip();
    var bd:BitmapData = new BitmapData(clip.width, clip.height, true, 0xFFFFFF); // set the color to 0xFFFFFF if you use transparent png file for the pattern
    bd.draw(clip);
    _background.graphics.clear();
    _background.graphics.beginBitmapFill(bd);
    _background.graphics.drawRect(0, 0, widthOfTheScreen, heightOfTheScreen);
    _background.graphics.endFill();
}

问题解决了

于 2012-06-19T06:24:12.717 回答