2013-01-24 47 views
0

將stage.fullScreenSourceRect,stage.displayState設置爲StageDisplayState.FULL_SCREEN_INTERACTIVE;並renderMode到GPU,鼠標位置被錯誤地讀取。這不僅適用於mouseX和mouseY的位置,而且所有與Sprites,Buttons等的鼠標交互都無法正常工作。MAC OS X + stage.fullScreenSourceRect + renderMode設置爲GPU =錯誤的鼠標位置

有人知道這個問題的解決方案嗎?

我在bugbase.adobe.com報告了一個錯誤,但是還沒有迴應。

錯誤ID:3486120

有連接有簡單的示例項目。如果您也有這個問題,並且您不知道任何解決方法,請至少爲該錯誤投票。

謝謝。 Greg。

回答

0

有趣的bug。我想你可以通過在全屏時自行縮放和定位內容來解決它。與設置fullScreenSourceRect相比,這可能會影響性能,但至少應該起作用。

一個例子(在你的文檔類使用):

protected var fakeFullScreenSourceRect:Rectangle; 

public function Main() { 
    this.stage.scaleMode = StageScaleMode.NO_SCALE; 
    this.fakeFullScreenSourceRect = new Rectangle(30, 30, 400, 200); 
    this.stage.addEventListener(Event.RESIZE, handleResize); 
} 

protected function handleResize(e:Event):void { 
    if (this.stage.displayState == StageDisplayState.FULL_SCREEN || this.stage.displayState == StageDisplayState.FULL_SCREEN_INTERACTIVE) { 
     if (this.fakeFullScreenSourceRect) { 
      this.scaleX = this.stage.stageWidth/this.fakeFullScreenSourceRect.width; 
      this.scaleY = this.stage.stageHeight/this.fakeFullScreenSourceRect.height; 
      this.x = -this.fakeFullScreenSourceRect.x * this.scaleX; 
      this.y = -this.fakeFullScreenSourceRect.y * this.scaleY; 
     } 
    } else { 
     this.x = this.y = 0; 
     this.scaleX = this.scaleY = 1; 
    } 
} 
+0

感謝您的答案。我嘗試過這種解決方案,但由於性能大幅下降,這種解決方案並不令人滿意。 「原生」調整大小會更好,並且是在Windows上。再次感謝您的幫助。 – drunkcat