0
遇到問題試圖滾動的BitmapData放在這裏半像素是我的原代碼AS3 BitmapData複製像素半像素?
var speed:Number = 1;
_bitmapData.copyPixels(_backgroundParallax, _screenRect, _zeroPoint, null, null, true);
_backgroundParallax.copyPixels(_backgroundParallax, new Rectangle(0, 0, speed, _backgroundParallax.height), new Point(_backgroundParallax.width-speed,0), null, null, false);
_backgroundParallax.scroll((speed*-1) , 0);
其工作,直到我改變變種速度爲0.5,這是因爲.scroll方法希望廉政局的,所以我複製哪些滾動在做嘗試,並允許0.5像素
var speed:Number = 1;
_bitmapData.copyPixels(_backgroundParallax, _screenRect, _zeroPoint, null, null, true);
_backgroundParallax.copyPixels(_backgroundParallax, new Rectangle(0, 0, speed, _backgroundParallax.height), new Point(_backgroundParallax.width-speed,0), null, null, false);
_backgroundParallax.copyPixels(_backgroundParallax, new Rectangle(0, 0, _backgroundParallax.width, _backgroundParallax.height), new Point((speed*-1),0), null, null, false);
這又偉大工程的時候,速度是1,但同樣都當它被設置爲0.5
任何想法不動?
不幸的是,像素沒有一半大小完整下載的源代碼。也許你可以用一些數學來減慢速度。 – 2012-02-17 10:30:21
您是否嘗試多次調用此代碼來滾動位圖,但想要降低執行速度? – sch 2012-02-17 11:00:26
@sch這個代碼是在enterframe上運行的 – rorypicko 2012-02-17 11:08:14