Problem description:
I investigated the last idea a bit, and I'm able to get these inputs working partially, but one thing is still not working. I'm going to set an iconned titlebar within the map as a screen object, and include a close (X) button in it. I however, after searching through the skin guide and the mouse procs, am lost on how to control it. I'd like to be able to drag the window (which has the titlebar disabled) around by this icon titlebar.
Like.. click the icon titlebar, move the mouse and the window follows the mouse around.
I need to know..
1) How to reposition a window
2) How to properly work the mouse procs.. I'm a little confused on which ones would work the best here, for example; Click and Mousedown
Thanks.
Oct 19 2012, 1:02 am
Best response
|
|
In pseudocode it could look about this:
|
Are those real procedures, though? I have no idea what to edit when it comes to window movement, or mouse actions.
|
http://en.m.wikipedia.org/wiki/Pseudocode
Read the reference it has tons of info about Mouse actions and search the forums ... |
I'm pretty sure in my post I wrote that I read through the mouse procs already, you should read the post more carefully before suggesting that, sir.
Anyhow, I know thats psuedocode, I was making a point. I'm lost as far as the procs go, psuedocode isn't going to help me much here. |
http://www.byond.com/docs/ref/skinparams.html#mouse
http://www.byond.com/docs/ref/info.html#/DM/mouse You can change the position of the window with the pos paramater. ex; winset(client, "default", "pos=x,y") The issue with using mouse controls with this, is that there is no pixel precision when you drag something within the same icon/tile. It only properly calls MouseDrag() when you change tiles. Probably some hacky ways to do it though. |
That directly sets the position of the obj, so I'd call it in like MouseDrag() I guess from what I see... but it seems like it'd be kinda' weird. How do I get the location of the mouse? I'm having a hard time comprehending these procs, because I don't understand how they're handling their objects.
I seen pos and thought that might be what I need, so I'm glad you suggested that ssx. I'm just trying to get the effect of this window dragging along with the mouse wherever I want to set it. It's not the main window, just a 96x32 window holding a map control. Hrn |
Essentially, you could set the "is-disabled" paramater on the map control - and the entire thing will be draggable, I'm pretty sure. (Not sure if mouse events will function though?)
|
Well, if that can happen then I don't really need mouse events for this? Uhm.. setting that to true will.. wont setting it to true stop -everything- I try to do with the control? I'm using screen objects on the map to create custom inputs for text and popup menus
|
If you are having trouble understanding the inner-workings of some of the mouse functions, try putting these into your code:
atom/Click(location,control,params) It will display to you all of the information that is acquired when you use those mouse procs. This might help you better understand them and how to use them. |
It might be better to use client mouse control procedures.
I actually had this in my code for testing of things. (Found some funny quirks too.) client |
Ok, I woke up and tried what you suggested SSX; I disabled it with the checkbox in the control's properties, and started it up to try it out. As far as I see, it works pretty well. There is one issue though... the window moves ridiculously far away from where I picked it up with the mouse, almost like it's offset a lot. Is there anyway to fix this behavior?
Also, thanks a lot for those two bits of code you guys gave me, I'm going to work with them and see if I can get the hang of these procs. |
In response to Kitsueki
|
|
Kitsueki wrote:
Ok, I woke up and tried what you suggested SSX; I disabled it with the checkbox in the control's properties, and started it up to try it out. As far as I see, it works pretty well. There is one issue though... the window moves ridiculously far away from where I picked it up with the mouse, almost like it's offset a lot. Is there anyway to fix this behavior? I don't have an issue with the mouse getting offset, or anything. Also, Did you check if you're able to use mouse procedures at all on the map when it's 'disabled'? |
In response to Super Saiyan X
|
|
I'm actually testing out the mouse procs atm, and when hovering over that map, none of them excecute, so I'm assuming no. They do work otherwise.
Maybe I can share my screen and show you what's going on? |
Ok, that odd dragging thing I was experiencing was limited to just me, due to a setting I had in a styler program for WinXP, Window Snap.
Turns out I didn't need to use maps, I could just set the icons as images for the window itself, and add the controls I wanted with images too. So, yes, i can customize my chat commands~ http://imgur.com/kwNyA Thanks for the help everyone. |