Prevent App From Being Resized?

Is it possible to prevent an app from being resized? On Android phones, some people are using their phones feature to do custom sizes for apps and have it be used in a floating window. This breaks some stuff in my game since I have off screen elements that are hidden beyond the usual screen borders.

I tried searching but couldn’t find anything on this. If there’s a way to block this kind of behaviour, that would be useful to know!

I don’t have an answer to your question, but you’re bringing up some things that raises some questions…

In Android, the only floating window effect I’m aware of is the pop-up view, and unless something has changed, this option is not available on Solar2D apps, including split-screen.

Even with apps that supposedly use/enable this feature, such as “Floating Apps” app, still doesn’t work on Solar2D apps (just did a quick test on this one).

I’m curious as to what’s being done on the user side to accomplish an app window resize, and how that affects objects that are supposed to be drawn off-screen; I would think that the windowed app is forced into a self-contained area.

I also don’t find anything out of the normal means while searching around.

I think you might be able to set resizeableActivity = false for Android in the build.settings, see:

Here’s what some players are telling me after they did this exploit:

“I have Play Pass, and I accidentally stumbled upon this when using a pop out window. When changing the window to a screen size the game is not used to, the tip jar becomes visible. I doubt this is intended behavior, so I’m sending it here as a bug.”

“Some phones don’t have it
But you can resize apps
In developer mode (a secret setting u unlock in ur phone) you can enable “force app screen resize”
But it tells you some apps may bug out”

And here’s a screenshot from a player. Notice the game area in the middle and the black borders that reveals off screen content (including the orange button at the top corner, which is the exploit in this case).

1 Like

Not home right now but I’ll check this out later!

OK, that makes sense. :slight_smile:

If what Xedur suggested doesn’t fix it then I believe your only solution would be to actually handle the resize event as this is not handled automatically once the application is launched to match a certain screen size.

Now, since the app is not meant to be resized at all then you can also just place the off-screen objects really far off.

EDIT:
I’m also thinking that in the event someone tries to force a resize by unconventional means, you could force the app to exit. You can simply check how much the width has changed, compared to the width at app launch, during a resize event; since your app is set to portrait mode (technically it should only resize on its height due to navigation or status bar changes).

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.