Skip to content

Commit

Permalink
#27 using flex-width as scale method
Browse files Browse the repository at this point in the history
  • Loading branch information
wpernath committed Sep 1, 2022
1 parent 91b3b1b commit 195f5ec
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
17 changes: 17 additions & 0 deletions melonjs-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions melonjs-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@
"docker-build": "docker build -f src/main/docker/Dockerfile.nginx -t quay.io/wpernath/grumpycat-melonjs:latest .",
"docker-push": "docker push quay.io/wpernath/grumpycat-melonjs -a"
},

"browserslist": "defaults",

"dependencies": {
"browserslist": "defaults",
"dependencies": {
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-node-resolve": "^13.3.0",
"core-js": "^3.24.1",
"css-loader": "^6.7.1",
"melonjs": "^13.3.0",
"rollup": "^2.75.7",
"screenfull": "^6.0.2",
"style-loader": "^3.3.1"
}
}
12 changes: 10 additions & 2 deletions melonjs-client/src/main/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import MultiplayerGameOverScreen from './js/stage/multiplayer/mp-game-over';
import { MultiplayerMessage } from './js/util/multiplayer';

import HowToPlayScreen from './js/stage/how-to-play'

import screenfull from "screenfull";



Expand All @@ -52,7 +52,7 @@ device.onReady(() => {
//video.
if (!video.init(1024, 768, {
parent: "screen",
scaleMethod: "fit",
scaleMethod: "flex-width",
renderer: video.AUTO,
subPixel: false,
//doubleBuffering: true
Expand All @@ -61,6 +61,7 @@ device.onReady(() => {
return;
}


// initialize the debug plugin in development mode.
if (process.env.NODE_ENV === 'development') {
import('js/plugin/debug/debugPanel.js').then((debugPlugin) => {
Expand All @@ -72,6 +73,13 @@ device.onReady(() => {
// Initialize the audio.
audio.init("mp3,ogg");

if( device.isMobile ) {
if( screenfull.isEnabled ) {
console.log("INFO: Requesting full screen...");
screenfull.request();
}
}

// allow cross-origin for image/texture loading
let environment = CONFIG.environment;
let baseURL;
Expand Down

0 comments on commit 195f5ec

Please sign in to comment.