GetButtonPic? Possible suggestion for next version of AGS?

Started by monkey0506, Sun 05/09/2004 02:17:18

Previous topic - Next topic

monkey0506

Is it possible to find out what the button picture is of the button at coordinates (mouse.x, mouse.y)? I'm trying to script keyboard control of the mouse cursor with the arrows moving the cursor (works), enter performing a left click (works), and tab performing a right click (works). I say that the left and right clicks work, but there is one complication. I have the script to run the on_mouse_click function for LEFT or RIGHT on enter and tab respectively. This doesn't highlight the buttons as the "pushed image" does when I left or right click with the mouse. I tried doing this:

SetButtonPic(GetGUIAt(mouse.x, mouse.y), GetGUIObjectAt(mouse.x, mouse.y), 1,

and then I encountered an error. I had hoped to use something like "GetButtonPic(GetGUIAt(mouse.x, mouse.y), GetGUIObjectAt(mouse.x, mouse.y))+1", but GetButtonPic isn't one of the engine's functions... Does anyone know how to do this?

EDIT: I forgot to mention, and not sure if it matters, but I want keyboard AND mouse control of the mouse cursor.

EDIT: I just searched the forums, and found that Goot asked a similar question nearly a month ago. He seemed to know an alternate, although lengthy way of doing it involving ints? Also, could this function perhaps become a suggestion for the next version of AGS? I would like to see this if it is possible...  ;D

Edwin Xie

Hmm...I don't know...it doesn't sound useful to me...... :-\
Moving at superhigh speed getting to the planet called Earth. But it is boxed in white......thing.....

Moox

#2
I would find it usefull for my current project

Mr Jake

you can do it just by adding 'SetGlobalInt(button#, sprite#)' after each SetButtonPic

monkey0506

#4
Yes, but then I would have to set each normal button pic, and then set the global variable, and then in on right click, test the global variable, then set the appropriate button pic (pushed pic, but in the normal slot so it looks pushed) and then set the same button back... It seems kind of lengthy. Is there another way?

EDIT: I'm renumbering my buttons so I can create a couple of custom functions that will handle this. I have to go to church, so when I get back I'll elaborate more.

function GetNormalButtonPic(something will probably go here){
//stuff
}
function GetPushedButtonPic(diddo){
//more stuff
}

Mr Jake

its not really that length, its an extra line of code each time you change the button pic :/

Scorpiorus

Yep, something like GetButtonPic(int gui, int object, int which) would definitely be useful in that case.

Pumaman


monkey0506

w00t!!! Not only did I make the tech forum, I made a useful suggestion! Wait, this post kind of cancels out the cancellation of some of my n00b status doesn't it? Dang it...

SMF spam blocked by CleanTalk