Designing a better framework

Moderator
Posts: 771
Joined: 2003.04
Post: #16
Right, I think it is using the 2/3rds rule or "visually centered" as recommended in the Apple Human Interface Guidelines:
[url="http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGWindows/chapter_17_section_4.html#//apple_ref/doc/uid/20000961-BACFHDHE"]
Apple Human Interface Guidelines: Window Behavior - Positioning Windows[/url]
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #17
"centered" on Mac OS X means "the alert position" usually, which is slightly above centered vertically. This is correct behavior!
Quote this message in a reply
Member
Posts: 161
Joined: 2005.07
Post: #18
OneSadCookie Wrote:"centered" on Mac OS X means "the alert position" usually, which is slightly above centered vertically. This is correct behavior!
I'm making a game, not an alert screen. For example, Halo shows up in the center of the screen, as do all the various apps I use (and the loading screens for UT2k3 and CoD2). I'm used to having the game screens centered, and I'd like to replicate it for my own games.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #19
... and I prefer having the window in the correct place Rasp

Stop wasting your time worrying about it Wink
Quote this message in a reply
Member
Posts: 161
Joined: 2005.07
Post: #20
OneSadCookie Wrote:... and I prefer having the window in the correct place Rasp
You prefer it at the top of the screen because new Finder windows appear in that position. I prefer it in the center because all the games on my computer appear in that position. I wonder which one is more relevant here. Wacko
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #21
Default or Expected behaviour wins, go with it.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #22
Well, you can always tweak the SDL source to get the exact behavior you want. Or, use a horrible hack like:
Code:
setenv("SDL_VIDEO_WINDOW_POS","0,0",1);
Add it before you create your surface "0,0" being "bottom,left" corner position relative to the bottom left of your screen.

(warning: just found a getenv("SDL_VIDEO_WINDOW_POS") in SDL source thanks to spotlight, might break things - I didn't test this other than to verify it changed the starting position of the main window)
Quote this message in a reply
Member
Posts: 161
Joined: 2005.07
Post: #23
Wow! The stubborn window finally moved to the middle of the screen! Unfortunately it has a weird side effect, which is that the video itself shifts up and to the right the same amount as the window moved from (0, 0). Here's what I mean:

[Image: SDL_video.png]

Really promising except for the glitch!
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #24
imikedaman Wrote:For example, Halo shows up in the center of the screen...
Halo also doesn't properly capture the screen or the mouse, which means you can exposé the game window in fullscreen mode - Joy! Moral of this is to do what's right, not what other people do - unless their right Wink

That said my current engine doesn't do the two-thirds thing either - it's centred plus a nudge upward - but that's mostly 'cause I'm lazy and haven't fixed it yet.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #25
Both Cocoa and Carbon have simple routines to put the window in the right place Wink
Quote this message in a reply
Member
Posts: 161
Joined: 2005.07
Post: #26
OneSadCookie Wrote:Both Cocoa and Carbon have simple routines to put the window in the right place Wink
Yes, I already tried a few ideas and listed them on the first page. I was trying to get a window reference and move the window that way, but needed help figuring out how since my ideas failed.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #27
Code:
[[NSApp mainWindow] center]

but you've already said that SDL's doing that for you (it should be) and you don't want it to (you should).
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Designing a 2D game... Canter 2 2,569 Feb 17, 2007 10:45 PM
Last Post: AnotherJake