The scale mode controls whether objects onscreen change size when the window changes size. It doesn’t prevent the window itself from being resized. If it helps, I made a demo to show the difference between each scale mode.
If that’s not the problem, could you provide some screenshots?
The scale mode controls whether objects onscreen change size when the window changes size.
That’s exactly what I meant. The content of the window (maybe the div element that contains the canvas) should not be stretched when resizing the window.
Maybe It should somehow change the properties of the div to be absolute dimensions instead of relative.
I’m sorry, I can’t provide a screenshot right now, because I’m not at home.
scaleMode is not implemented on any target except Flash right now, I think. The default behavior for HTML5 is to 1.) stretch to the full window size if you use 100% size in your XML, 2.) in the default HTML5 template, to letterbox and scale up content that has a specific width/height size in XML, and 3.) to match whatever size DIV you give it in your HTML template, you can control the size of the project by leveraging different CSS in your page, or using openfl.embed on a different DIV or canvas element
Hi. Yes, I understand the reasoning.
However, in some cases, where a feature is only implemented for a certain platform, there is an error in the function itself. I’ve seen it when trying to compile a project using BitmapData’s perlin noise. I think something like this is worth implementing for scale mode, so future users will know it’s by design and not a mistake.
Using custom template to change the div’s css is the preferred way. Another suggestion is using scale mode to dynamically change the div’s style properties from relative (100%) to absolute (100px), but this is too far fetched, so “not implemented” is ok.
Thank you
I’d be happy to hear ideas on how we make this clearer, I don’t want to add too much chatter to traces, and I don’t like adding unneeded runtime crashes with a throw
Perhaps, Warning: stage.scaleMode is not implemented
Something to communicate what’s happening, but not to break a project.
I wonder if there’s a way someone could write a macro, so where could push messages into the build log, instead of runtime, so you could get compatibility warnings when building somehow?
Sorry for the resurrection, but is this still not supported? I needed to have NO_BORDER scale/viewport in my app so it always fills the screen but crops a little from top and bottom based on app size/ratio & screen size/ratio, is this going to be implemented for all targets or should this be done with custom code manually?
We currently use two different modes, one where we expect you to handle Event.RESIZE yourself, and one where we preserve the original width/height and scale/letterbox as needed. In the future I want to support more modes using stage.scaleMode, right now the property is a non-op