Make app size more or less(to normal) - mobile


I made a app in html5 target. The app is no_scale mode (w/h = 0) .

WHat i can do for change size like magnifier two fingers resize? For example open I can change size, and return to normal of two fingers tap, how i can do that for my app? (maybe settings again ?)


You could use the DOM target, and allow the browser to do that, or look at our default HTML file output, which I think cancels touch scrolling, but you could remove this in your own “index.html” template to allow it


Thx for u answer. But I dont understand what u mean.
I use second way and remove :

    		window.addEventListener ("touchmove", function (event) { event.preventDefault (); }, false);
    		if (typeof window.devicePixelRatio != 'undefined' && window.devicePixelRatio > 2) {
    			var meta = document.getElementById ("viewport");
    			meta.setAttribute ('content', 'width=device-width, initial-scale=' + (2 / window.devicePixelRatio) + ', user-scalable=no');

after that - and after load the page, app looks bigger (elements size) than before, but touch magnifier did not allow too… (((

Project setting . And that its very intresting

  1. without allow-high-dpi the app set stage size is 1/2 of device size
  2. with allow-high-dpi the app set real stage size
  3. with allow-high-dpi and remove script - stage has DIFFRENT size than 1 or 2. WHat is that?


You could try removing the "touchmove" listener, but leave the code that is setting the viewport

EDIT: Oh, it might also be necessary to make sure that double-click events go through. Double tapping somewhere other than the OpenFL content will probably still zoom, but it’s possible that we’re handling the double click and canceling the default event

EDIT 2: However, looking at our code, I only see us canceling mouse events to prevent a context menu:


I mean : tap one finger, and hold it, tap other finger and move = makes zoom + or - , not double click. Standart feature to zoom photos in mobile (browser, apps, standart pictureViewer) for example. My openFL content 100%100% of window, so I dont have any elements for zoom, i want to zooming OpenFL content!


Perhaps user-scalable=yes would make a difference?


Yes Im trying it, nothing happens ((( maybe u can test it? Thanks a lot


No ideas ??? anybody ??? (((
Maybe somebody knows how open App on LANDSCAPE mode only? After loaded page - set landscape and lock it for change orient ?


Experimenting here, it looks like resizing the window works fine, until touching an area where OpenFL is embedded, where it is consuming the mouse events:

I’ve opened an issue here :slight_smile:

In the meantime, you should have a lot of flexibility using CSS to control how your application sizes


U say, I can wrap openFL content in CSS classes and control sizes ?


Yep, absolutely. Resize the DIV that the content is embedded in, and it should resize OpenFL accordingly, just be careful about dynamic sizes because we might run into a resize loop


And what do u think about FIXED landscape? How it must be setted? I want to open app in landscape only after loaded, no portrait, also I want to be loaded in LANDSCAPE at once, not portrait and after one second change to landscape for example.


Mobile native applications can require a specific orientation, but browser applications can only display something like “Please rotate your screen” with an icon to try and encourage the user to do so


no way for browser, i understand(((