home *** CD-ROM | disk | FTP | other *** search
/ ring.yamanashi.ac.jp/pub/pc/freem/action/ / action.zip / baku100.zip / baku100 / Kernel / MouseEvent.tonyu < prev    next >
Text File  |  2001-08-19  |  590b  |  35 lines

  1. extends classes.lang.Object;
  2.  
  3. constructor MouseEvent(){
  4. }
  5.  
  6. function getTarget (x,y) {
  7.   var i,c,p;
  8.   i=0;c=$chars.size();
  9.   while(i<c) {
  10.    p=$chars.get(i);
  11.    if (p.crashAt(x,y)) return p;
  12.    i=i+1;
  13.   }
  14.   return 0;
  15. }
  16.  
  17. function onDown(x,y,lb,rb) {
  18.   var t;
  19. //  t=getTarget(x,y);
  20.   if (t) t.onMouseDown(x,y,lb,rb);
  21.   else {
  22.     if ($map ) $map.mouseDown(x,y,lb,rb);
  23.   }
  24. }
  25.  
  26. function onDrag(sx,sy,dx,dy,lb,rb) {
  27.   var t; 
  28. //  t=getTarget(sx,sy);   
  29.   if (t) t.onMouseDrag (sx,sy,dx,dy,lb,rb);
  30.   else {
  31.     if ($map ) $map.mouseDrag(sx,sy,dx,dy,lb,rb);
  32.   }
  33. }
  34.  
  35.