2012-06-19 97 views
0
位圖重複x和y

快速的問題,我試過以下,它不工作AS3位圖重複-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 

乾杯 比爾

回答

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(); 
} 

問題解決