簡體   English   中英

在android中無法全屏phaser + webpack + cordova

[英]Can't fullscreen phaser + webpack + cordova in android

我使用Phaser-ce 2.7.3Webpack 2.2.0Cordova 6.4.0我的代碼

import 'pixi'
import 'p2'
import Phaser from 'phaser'

import BootState from './states/Boot'
import MenuState from './states/Menu'
import GameState from './states/Game'
import WinState from './states/Win'

class Game extends Phaser.Game {

constructor () {
   const width = window.innerWidth
   const height = window.innerHeight
   super(width, height, Phaser.CANVAS, 'content', null)
   this.state.add('Boot', BootState, false)
   this.state.add('Menu', MenuState, false)
   this.state.add('Game', GameState, false)
   this.state.add('Win', WinState, false)

   this.state.start('Boot')
 }

}

window.game = new Game()

並且全尺寸屏幕的內容在按鈕中獲得黑線

在此輸入圖像描述

修復cordova-custom-config插件並添加

<preference name="android-manifest/application/activity/@android:theme" value="@android:style/Theme.NoTitleBar.Fullscreen" /> to config.xml

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM