bvlgari

Veteran
Veteran
Joined
Jan 14, 2018
Messages
36
Reaction score
5
First Language
english
Primarily Uses
RMMV
I was wondering if anyone using this method, is able to debug the project on android 12 (api 31) , clearly something changed from api 30 to 31. (game loads, i get black screen, can't see anything, but game "works") I would appreciate information about this topic. i.e. what to change on build.gradle(app).

I can give further information.
 

GamesOfShadows

♥ Gamer/Games ♥
Veteran
Joined
Jan 31, 2017
Messages
81
Reaction score
60
First Language
German
Primarily Uses
RMMZ
Finally got my MZ test game on my Android! :D I followed another tutorial first, but unfortunately there was a problem that I couldn't solve, here was the problem with the black screen, but I had already gotten a solution from the previous tutorial:
What helped me is to add the following to the 'index.html' in the project at <body style="background-color: black">: onload="window.focus()"

So it should look like that: <body style="background-color: black" onload="window.focus()">

Here is an example of my index.html:

HTML:
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
        <meta name="viewport" content="user-scalable=no">
        <link rel="icon" href="icon/icon.png" type="image/png">
        <link rel="apple-touch-icon" href="icon/icon.png">
        <link rel="stylesheet" type="text/css" href="css/game.css">
        <title>TestProject</title>
    </head>
    <body style="background-color: black" onload="window.focus()">
        <script type="text/javascript" src="js/main.js"></script>
    </body>
</html>

EDIT: Game was exported with MZ. Works perfect. :)

EDIT2: For "portrait"-Mode that didn't worked, I also found another solution (I don't know if this works with MV too): open "rmmz_managers", go to line 2109 and add return true;

So it's look like this:
JavaScript:
SceneManager.isGameActive = function() {
return true;
    // [Note] We use "window.top" to support an iframe.
    try {
        return window.top.document.hasFocus();
    } catch (e) {
        // SecurityError
        return true;
    }
};
 
Last edited:

bvlgari

Veteran
Veteran
Joined
Jan 14, 2018
Messages
36
Reaction score
5
First Language
english
Primarily Uses
RMMV
Cool. In my case that addition to the body element didnt make a difference. In fact, i have discovered that my problem is related with my machine/virtual device. I have tested my project on the most recent android versions on different platforms and works. So, if anyone is at this situation, consider that your virtual devices(from android studio) could be misconfigured/not working correctly before you start tinkering your code.
 

Latest Threads

Latest Posts

Latest Profile Posts

Bex
Finally upgraded to RMMZ.
ScreenShot_11_28_2022_7_52_34.png
FINALLY, I figured out how to get the "tail" to appear IN the window and not directly below it lol. now it looks like it's part of the window and not hanging from the bottom of it.
Twitch! Stream is about to go live with some Dark Souls 2! Feel free to drop by!
Has anyone ever wanted to choose how they play? I've been working on Black Moon, a project where you can fight against ancient beasts by commanding an army of former gods and goddesses. But what makes it different is that there are different ways to give your choice heroes either Red, Green, or Blue weapons/armor, and each grants different abilities. More coming soon!
Can Elon crash Twitter faster? I want something as big to replace it so I can promote my game there. I also need to actually do promotion this time, heh.

Forum statistics

Threads
126,916
Messages
1,182,341
Members
166,747
Latest member
wakkywack
Top