Screen resolution is 1280x720 in docked mode [solved]
-
If I have my switch in the docking station and start a project the screen resolution is 1280x720 and
gWidth()
andgHeight()
are showing this by returning 1280 and 720.
Is that on purpose?Just a situation that was confusing, also you can resolved this by setMode(1920, 1080) on the very first line:
If the game usessetMode(1920, 1080)
later and does aclear(blue)
for example, anyupdate()
call after a restart will draw a black box in the top left corner untilsetMode(1920, 1080)
andclear()
was called again.The other problem with that behaviour is, I tend to do projects with avoiding
setMode()
and therefore I just modify the object sizes according togWidth()
andgHeight()
. -
To clean the screen properly (if docked) it seems to need two
clear()
calls. This cleans the screen:setMode(1920, 1080) clear() update() clear() // main loop // with an additional update()
-
What I do to avoid this is internally render my game at 1920x1080, then scale / draw it each frame to a 1280x720 target if the player is in handheld mode. Both "Skatey-Cat" and "Dredge" do this.
That way, all of the math in my game to position things stays static. Plus, it has a "cool" factor in that it's how modern game engines work (their internal resolution is always different than the final output resolution, after image reconstruction, temporal anti-aliasing, etc.).
-
I'm not sure I understand. If you have a program like this:
print( gWidth(), " ", gHeight() ) update() sleep(5)
Does it not show "1920 1080" when you run it in docked mode?
-
@Kat the first time it shows 1920 1080, the second time I run it, it shows 1280 720.
š³ I hope my switch is not broken.
After restarting FUZE it only shows 1280 720.
Also after reboot ing the Switch. -
That's very strange. I've not heard of that happening before but I'll see if I can find a way to recreate it. I wonder what would display if you ran the example code for the docked() function. But if your Switch is still sending signal to the TV even when it's showing 1280 then I guess that's not related.
-
@kat the
docked()
example code from the help works: it showsConsoel is in TV mode
-
Thank you, that's good to know.
-
-
@Kat thanks for your efforts. I got feedback on twitter, that brought me to the solution: it was a problem of the attached screen. I tried it with another screen and everything works fine, I get 1920x1080 as the default resolution. But I will think about, how to apply setMode(), if someone plays with a screen that does not support 1920x1080. It looks like one should not avoid setMode() if the games calculations are done based 1920x1080. And its also not enough to just check if docked() is true or not to switch the resolution.
-
Ahh ok that makes sense. Glad you got to the bottom of it! :)