Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-03-2007, 01:59 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
GUIs in a QMenu

I made a Q Menu which uses GuiShowImgCtrls to show the images. It all works fine, except I need to make a dropping system. There's no way to tell if the item is being dragged! Any suggestions?
__________________
Reply With Quote
  #2  
Old 05-03-2007, 02:00 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Why would you make it with GUI controls, just curious...
Reply With Quote
  #3  
Old 05-03-2007, 02:01 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by cbkbud View Post
I made a Q Menu which uses GuiShowImgCtrls to show the images. It all works fine, except I need to make a dropping system. There's no way to tell if the item is being dragged! Any suggestions?
Use GuiShowImg controls to make the images to begin with, and you can use thiso.catchevent(this.name, "onMouseDrag", "onDragItem"); or something. The first parameter should be the variable the GuiShowImg is represented by.

Quote:
Originally Posted by Rapidwolve
Why would you make it with GUI controls, just curious...
I made mine on Niromia with GUI Controls, and I usually make image-based GUIs using GuiDrawingPanel. Although in this case, I would agree that using a showimg would be much better.
__________________
What signature? I see no signature?
Reply With Quote
  #4  
Old 05-03-2007, 02:03 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Rapidwolve View Post
Why would you make it with GUI controls, just curious...
How do you propose I do it?
__________________
Reply With Quote
  #5  
Old 05-03-2007, 02:07 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by cbkbud View Post
How do you propose I do it?
PHP Code:
showimg(1000"image.png"00).layer 4
... Would show an image at (0, 0) on the screen layer.
Thats basically how GUIs themselves are made :P
__________________
What signature? I see no signature?
Reply With Quote
  #6  
Old 05-03-2007, 02:09 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by cbkbud View Post
How do you propose I do it?
showimg()
Reply With Quote
  #7  
Old 05-03-2007, 02:13 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Rapidwolve View Post
showimg()
eww.
__________________
Reply With Quote
  #8  
Old 05-03-2007, 02:34 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Quote:
Originally Posted by Rapidwolve View Post
Why would you make it with GUI controls, just curious...
I made mine on Mythic using GUI controls too y'know.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #9  
Old 05-03-2007, 02:45 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by cbkbud View Post
eww.
Its ew but apparently you have no other choice, unless you wanted to script your own function which would be quite simple.
Reply With Quote
  #10  
Old 05-03-2007, 11:45 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
showimg() is simply exists for compatibility and is really just creating a TShowImg object. The GuiShowImgCtrl object extends GuiControl then implements TShowImg which adds support for offset inside of the control itself and interactions with other GUI Controls.

The findimg() function creates a new image (TShowImg) of the specified ID if one cannot be found. However, objects that extend GuiControl are all static and can be changed from distant objects, this might or might not be useful in your case.

In the end, I would suggest using GuiShowImgCtrl because it inherits all features of GuiControl, obviously designed for GUIs. Using showImg() will not give you these features.
__________________
Reply With Quote
  #11  
Old 05-04-2007, 03:05 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Inverness View Post
showimg() is simply exists for compatibility and is really just creating a TShowImg object. The GuiShowImgCtrl object extends GuiControl then implements TShowImg which adds support for offset inside of the control itself and interactions with other GUI Controls.

The findimg() function creates a new image (TShowImg) of the specified ID if one cannot be found. However, objects that extend GuiControl are all static and can be changed from distant objects, this might or might not be useful in your case.

In the end, I would suggest using GuiShowImgCtrl because it inherits all features of GuiControl, obviously designed for GUIs. Using showImg() will not give you these features.
I know, that's why I use it. What I need to know is how to tell if it is being dragged. I can't find any variable, and there's no event for this.
__________________
Reply With Quote
  #12  
Old 05-04-2007, 06:35 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by cbkbud View Post
I know, that's why I use it. What I need to know is how to tell if it is being dragged. I can't find any variable, and there's no event for this.
Well for one, I don't think you should be dragging the GUI image itself, but rather when the mouse is held down on it you create a second separate icon that follows the position of the mouse on screen.

But there is an event that might help you.
Quote:
Originally Posted by Graal Bible
onMouseDragged(keymodifier,mousescreenx,mousescree ny) - the mouse is moved while the left mouse button is pressed
http://wiki.graal.net/index.php/Crea...ent/GuiControl
__________________
Reply With Quote
  #13  
Old 05-04-2007, 10:53 AM
middo middo is offline
VHE Monkey
middo's Avatar
Join Date: Aug 2002
Location: California
Posts: 327
middo is on a distinguished road
Send a message via AIM to middo
there is an onMove event you can listen for if you want. But that's not really what you want.

All I did was check the onMouseUp event (not exact name..) and checked to see if the new x was same as old x kinda thing.
Reply With Quote
  #14  
Old 05-05-2007, 01:11 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Inverness View Post
Well for one, I don't think you should be dragging the GUI image itself, but rather when the mouse is held down on it you create a second separate icon that follows the position of the mouse on screen.

But there is an event that might help you.

http://wiki.graal.net/index.php/Crea...ent/GuiControl
Okay, thanks.

When I first looked at that, I must have misread it, or skipped over it by accident.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:58 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.