vbGore Free Online RPG Engine

Revolutionizing Visual Basic ORPG Development
It is currently Sat May 25, 2013 8:34 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Window close with mouse
PostPosted: Thu May 15, 2008 10:16 pm 
Source Code Swashbuckler

Joined: Sun May 11, 2008 6:53 pm
Posts: 38
Window close with mouse

http://www.vbgore.com/Window_close_with_mouse

Is there a mess up? looks confused and broken hehe

Code:
    If Engine_Collision_Rect(MousePos.X, MousePos.Y, 1, 1, .Screen.X + '''''start x of close button(in my case 105)''''', .Screen.Y + '''''start x of close button (in my case 0)''''', '''''width (in my case 23)''''', '''''height (in my case 23)''''') Then
        If MouseLeftDown > 0 Then
            ShowGameWindow(LastClickedWindow) = 0
            LastClickedWindow = 0
            Exit Sub
        End If
    End If


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 2:56 am 
Slave to the BB

Joined: Sun May 27, 2007 6:54 am
Posts: 3110
Location: new york
well you have to actually put a value in those quoted out spots.


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 5:10 am 
Source Code Swashbuckler

Joined: Sun May 11, 2008 6:53 pm
Posts: 38
oh damn man I was so tired I never saw it so the
'''''start x of close button(in my case 105)'''''
'''''start x of close button (in my case 0)'''''
'''''width (in my case 23)'''''
'''''height (in my case 23)'''''


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 10:31 am 
Slave to the BB

Joined: Sun May 27, 2007 6:54 am
Posts: 3110
Location: new york
yeah. those need to be replaced with the actual values of your close button.


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 10:34 am 
Source Code Swashbuckler

Joined: Sun May 11, 2008 6:53 pm
Posts: 38
gutterpunk wrote:
yeah. those need to be replaced with the actual values of your close button.



Is there a simple way find the exact cords? I wish there was a way do it like -5 -5 or something lol or a way to measure it rather then the left side to the right but right to the left that way there all the same and simple.. get what I mean :P?


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 10:47 am 
Aleron Coder

Joined: Fri Jan 05, 2007 5:36 am
Posts: 2964
Location: Germany
this is covered in the wiki? ^^
I did it the same way lol xD

However I used a BtnClose Entry in the skins .ini

If you know how to do it I recommend doing it :P
I could also extend the Wiki entry by that optional part if someone wants me to.

Like this you can have different skins having different Close Buttons
(Size and Position)


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 11:35 am 
Source Code Swashbuckler

Joined: Sun May 11, 2008 6:53 pm
Posts: 38
so the in my case are default right? if so then thats fine ;)


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 12:19 pm 
Aleron Coder

Joined: Fri Jan 05, 2007 5:36 am
Posts: 2964
Location: Germany
in your case size and location are coded.
works fine, but all skins must have the same form ^^


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 12:44 pm 
Source Code Swashbuckler

Joined: Sun May 11, 2008 6:53 pm
Posts: 38
Zanval wrote:
in your case size and location are coded.
works fine, but all skins must have the same form ^^



I got it working Thanks..

Know what I would have rather seen though after seeing 4.png in GRH folder... Just let the code place a new X over the screen for you.. this 1 makes it more accurate 2 saves you more time playing the guess where I am game hehe.. Also makes it so if you change the skin/style u don't have to spend all day redoing all the X's..

Not sure how hard it would be but I think it would be a great addition.


Major bug if you drag and put it towards the x or the invisible spot on the screen even if its centered in the window it crashes... Try it just click and hold down anywhere in the game and hold down the button while going to the x... Bang :(


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 1:57 pm 
Aleron Coder

Joined: Fri Jan 05, 2007 5:36 am
Posts: 2964
Location: Germany
missed a step adding the button?
and what does it crash on?


Top
 Profile  
 
 Post subject: Re: Window close with mouse
PostPosted: Fri May 16, 2008 2:14 pm 
Source Code Swashbuckler

Joined: Sun May 11, 2008 6:53 pm
Posts: 38
Zanval wrote:
missed a step adding the button?
and what does it crash on?


No miss step but rather then adding the button to the image like the skin by hand.. U should have the image in the code.. It places it on for you.. there is even a x button in the folder...

Also if you use debug mode or just run mode not a full compile you drag off the screen and onto or towards the x it crashes hehe


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group