Scaled resolution does not seem to work as expected

18 views
Skip to first unread message

Mariusz Pasek

unread,
Aug 29, 2020, 5:51:26 PM8/29/20
to excaliburjs
Hi,

according to this documentation it should be possible to separate real the resolution and the logical resolution of the game. I've been trying to achieve that on my own (the documentation does not specify how to use it unfortunately) and I was unable to. While going through the sources I noticed this and I was wondering if that's a feature that hasn't made it to version 0.24.3 or I wasn't using it properly. In case that it's not released yet, do you have any timeline on the next release then?

All best,
Mariusz

Erik Onarheim

unread,
Aug 29, 2020, 6:58:46 PM8/29/20
to excaliburjs
Hi Mariusz,

The unreleased Screen updates should help with this  https://github.com/excaliburjs/Excalibur/pull/1598/files#diff-e880ed8a4e1aaca76c5644422121326c Let me know if there are any gaps you foresee here, it's still pretty new and we could make some changes.

We should have time in the next week to cut another point release to get these changes out. Looks like our docs automation didn't published the associated documentation for this either, so we'll take a look at that as well.

Cheers,
Erik

Mariusz Pasek

unread,
Aug 29, 2020, 7:24:44 PM8/29/20
to Erik Onarheim, excaliburjs
Hi Erik,

Thanks for the quick answer! Yes, I think that it would cover my use case and getting these changes to my project this week would be great! On the other hand, shouldn't this functionality be covered by the current version as well? The documentation is suggesting so. My understanding is that if I set display mode to container, then the actual size of my app should be the same as canvas, while logical resolution would be expressed by width and height passed to the engine. This (I guess) should let me have a nice separation of logic resolution and the user visible one. However for some reason I was unable to switch display mode to Container properly. Whenever I was trying that the canvas dimensions were switched to 1140x0 (by engine?), even though CSS was setting them to 800x600. On the other hand exactly the same code worked correctly for Fullscreen mode. If you're interested you can find my configuration here.

Cheers,
Mariusz


--
You received this message because you are subscribed to a topic in the Google Groups "excaliburjs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/excaliburjs/-hekGGmSIT8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to excaliburjs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/excaliburjs/4c07cadb-0f77-4ede-be4d-c2c03a187c0cn%40googlegroups.com.

Mariusz Pasek

unread,
Aug 29, 2020, 7:33:02 PM8/29/20
to Erik Onarheim, excaliburjs
Huh, setting display mode to fixed seems to have done the trick. Is that then the appropriate way of getting separation of resolutions? Fixed display mode + width and height set to desired logical resolution, passing canvas ID of parent canvas and setting canvas size by separately to the final resolution? If that's the case then I feel that documentation could be more explicit about that scenario (unless I overlooked it). And I'm still not sure what I was doing wrong with the container mode.

Cheers,
Mariusz

Erik Onarheim

unread,
Sep 2, 2020, 9:28:17 PM9/2/20
to excaliburjs
Hi Mariusz,

We've cut a new version with the latest changes in Excalibur @ v0.24.4, the new screen docs are up here https://excaliburjs.com/docs/api/edge/classes/_screen_.screen.html

Let me know if you have issues with the new Screen resolution and viewport controls.

Answering your earlier questions, using DisplayMode.Fixed and manipulating the element manually was a way to achieve the desired effect (although not easy, documented, or discoverable for sure). I don't think the DisplayMode's are well documented either in their current form.

DisplayMode.Container is probably misnamed but it changes the aspect ratio of the game canvas as it's parent element changes "to match the container" in your case the body element which is likely where the 1140x0 came from unfortunately. 

I'm tempted to start deprecating the DisplayMode properties if the new Screen controls work in a less confusing way, please let me know how it goes :) 

We're interested in gathering feedback as well, let me know if you'd like to chat sometime in September

Cheers,
Erik

Mariusz Pasek

unread,
Sep 5, 2020, 6:09:04 PM9/5/20
to Erik Onarheim, excaliburjs
Hi Erik,

Thanks for letting me know! I just integrated this feature into my project and it works great so far. That's exactly the kind of logical separation that I was looking for. Great job!

By the way, I've noticed a weird thing about my app. It seems to be working just fine on PC, but it's not loading properly on mobile devices (I've checked Android phone and Iphone so far). On Android the app is loading and "just" malfunctioning, but on Iphone (8 plus) excalibur doesn't even show me the loader page. I'm planning to debug this problem anyway, but are there any known issues regarding launching Excalibur on mobile devices? In case you'd want to take a look. I'm hosting my service here - the website is still under construction, so it may be a bit unstable. And my source code is located here. All frontend related code is here.

Thanks again!
Mariusz


Reply all
Reply to author
Forward
0 new messages