WindowWidth and WindowHeight not working

Bugs will be moved here once resolved.

Post » Sat Feb 11, 2012 11:03 pm

When in fullscreen - scale mode, WindowWidth and WindowHeight doesn't return correct values as R0J0hound explains on second page of this thread:

http://www.scirra.com/forum/positioning-objects-relative-to-window_topic49069_page1.html

in theory scrollx-WindowWidth/2 should always return left edge of the viewport. it doesnt in fullscreen - scale mode. it does though, when in fullscreen - crop mode and width layout scale set to: min(WindowWidth/640,windowheight/480) - for 640x480 app.
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Sun Feb 12, 2012 4:05 am

I'm glad to find I'm not the only one having a similar problem. I made a post in the "How Do I?" sub-forum. Wasn't sure if it was a bug until R0J0 said something in this Ranma's topic.

http://www.scirra.com/forum/bottom-of-window-hud-scaling-issues_topic49009.html

My original post in the "How Do I?" has a more detailed description and a capx, but basically I can confirm it's an issue with improper window scaling in "Fullscreen (Scale)" mode.TL222012-02-12 04:05:57
B
57
S
20
G
7
Posts: 305
Reputation: 8,779

Post » Sun Feb 12, 2012 9:11 pm

As far as I can tell WindowWidth and WindowHeight always return the correct values. They are only supposed to return the browser inner window size and not the viewport in the game and that's what they do. If your calculations don't match up with the game then your math is wrong, because I think the expressions are working fine. Think this should be closed as not a bug.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun Feb 12, 2012 9:14 pm

I'd like to make a correction, it's not a bug at all. Instead of using the WindowWidth and WindowHeight expressions when in Fullscreen(scaled) mode, use the Edit time window size.
B
79
S
24
G
54
Posts: 4,738
Reputation: 40,739

Post » Sun Feb 12, 2012 9:24 pm

if game has a layout of 100x100 pixels and unbounded scrolling on, the fullscreen scaled option on, the set X to scrollX - windowWidth/2 should always position sprite on the left edge. If it should, this is a bug as it doesn't :) if it shouldn't this can be closed, but please, @Ashley or @R0j0 if you can help me in the other thread, please do, would be grateful! cheers!
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Sun Feb 12, 2012 9:57 pm

@ranma, no your math is wrong, as you scale up the window size the game viewport zooms according to the scale setting to keep roughly the same number of layout-coordinates between the middle of the screen and the left edge, but the WindowWidth expression will keep increasing so the object moves off to the left. Closing as not a bug.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests