我正在嘗試使用Phaser和CocoonJS創建一個遊戲。除了在使用canvas+渲染器在繭上部署遊戲時將畫布置於中心位置以外,一切正常。下面是三行代碼,它們實現了我在Web瀏覽器中尋找的效果,但不是canvas +。如何將畫布置於CocoonJS畫布中+使用Phaser
this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
this.scale.pageAlignHorizontally = true;
this.scale.pageAlignVertically = true;
下面的圖片是來自S3(也在iPad上覆制)的屏幕截圖,它顯示了正確的畫布裝飾,但沒有居中。有沒有人有任何關於如何中心畫布的見解,所以雙方都有黑條?我在繭啓動器應用程序上更改的唯一設置是允許不是兩個冪的圖像。
Small project reproducing the problem
試試這個:'this.game.scale.pageAlignHorizontally = TRUE; this.game.scale.pageAlignVertically = true; this.game.scale.refresh();' –
這不能解決問題 – eivers88