View Single Post
  #10  
Old 09-07-2007, 03:34 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
onActionMouseDown() will work on any level object that has a shape. You'll need setshape on both sides to get it to work clientside and serverside.

Edit: onMouseDown() is detecting of the mouse button is pressed at all, you'll need to check where the mouse actually is yourself. Would probably be better to set a shape and use the action event instead.

Edit2: Btw, I believe its actually onActionLeftMouse() and onActionRightMouse()

PHP Code:
// This is an NPC in a level.
function onCreated() {
  
setShape(13232);
}
function 
onActionLeftMouse() {
  echo(
"You have clicked on the serverside.");
}
//#CLIENTSIDE
function onCreated() {
  
setShape(13232);
}
function 
onActionLeftMouse() {
  echo(
"You have clicked on the clientside.");

Theres also:
PHP Code:
//#CLIENTSIDE
function onMouseDown(mode) {
  if (
mousex in |xx+2| && mousey in |yy+2|) {
    if (
mode == "left") {
      
// You left clicked it
    
}
    else if (
mode == "right") {
      
// you right clicked it.
    
}
  }

You would also want to check if the GraalControl is the GUI thats focused.
__________________
Reply With Quote