Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Hide or show titlebar depending on mouse

Author
Message
Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 25th Apr 2011 22:39
I am in the need of hiding the titlebar when the mousecursor is within the games window, but then show it once the cursor is outside.

The result I am getting is a flickering screen.

code:


Thanks in advance!

Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 25th Apr 2011 23:28
Check for X as well next to Y i guess.

Anyways why does this need to be a function?

-In.Dev.X: A unique heavy story based shoot'em ~12%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Apr 2011 14:36
Quote: "The result I am getting is a flickering screen."

Maybe because you are setting the window layout every time you run this function. This is going to cause problems no matter what you do (IMO).

Why are you changing the window layout? Why not just have it one way or the other? In my experience someone playing a game doesn't care about the border in a windowed game...

Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 26th Apr 2011 18:15
@Quel

Well, I will add so it checks for X too. But for testing there should be no difference

And I thought that a function would make the code cleaner

@baxslash

I want to hide the border since I am looking for a nice, graphical style in the game. And the border takes that away.
But still I want the player to be able to move around the window if needed.

I will see if I can come up with a way around

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Apr 2011 18:41
Quote: "But still I want the player to be able to move around the window if needed."

I'm not quite sure what you mean by that? Do you mean be able to move the mouse outside the window?

Why not just stick with no frame and add your own title bar if the user goes within say 30 pixels of the top of the window (if you really need the titlebar at all)?

Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 26th Apr 2011 19:02
The game is made for windowed mode, and when the game begins the window is a little off position. And if I remove the titlebar the player wont be able to center it on screen...

...Just came up with somethign better I guess

baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Apr 2011 19:09
Quote: "The game is made for windowed mode, and when the game begins the window is a little off position. And if I remove the titlebar the player wont be able to center it on screen..."

Oh. I guess it must be important for some reason.

Quote: "...Just came up with somethign better I guess"

Great. If you think it might help someone else please share. If not then don't worry about it.

Hope I helped in some small way

Cyborg ART
19
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 26th Apr 2011 19:12
Here is what I use:



It doesnt solve my original "problem", but it was a good way around

Quote: " Hope I helped in some small way "


You did Thanks!

Jimmy
22
Years of Service
User Offline
Joined: 20th Aug 2003
Location: Back in the USA
Posted: 26th Apr 2011 19:23
You can always do this:






May 10th / Geek Culture / Jerico2day-OBese87 / VOTE

Login to post a reply

Server time is: 2026-07-11 13:58:34
Your offset time is: 2026-07-11 13:58:34