- #已知$mx为鼠标x坐标, $my为鼠标y坐标 @按钮_位图为一个精灵 
-     if ($mx >= @按钮_位图.x and $mx <= @按钮_位图.x+@按钮_位图.bitmap.width) and ($my >= @按钮_位图.y and $my <= @按钮_位图.y+@按钮_位图.bitmap.height) 
-        x_b = @按钮_位图.x-$mx 
-        y_b = @按钮_位图.y-$my 
-       pixel = @按钮_位图.bitmap.get_pixel(x_b.abs,y_b.abs) 
-   
-       if pixel == Color.new(0,0,0,0) or pixel == Color.new(255,255,255,0) 
- return 
- #除了透明像素之外, 在精灵图大小以外的地方也会判断会另一种颜色, 因此不只一种 , 则满足为不在精灵图片之上 
- #已知$mx为鼠标x坐标, $my为鼠标y坐标 @按钮_位图为一个精灵 
 
-     if ($mx >= @按钮_位图.x and $mx <= @按钮_位图.x+@按钮_位图.bitmap.width) and ($my >= @按钮_位图.y and $my <= @按钮_位图.y+@按钮_位图.bitmap.height) 
 
-        x_b = @按钮_位图.x-$mx 
 
-        y_b = @按钮_位图.y-$my 
 
-       pixel = @按钮_位图.bitmap.get_pixel(x_b.abs,y_b.abs) 
 
-   
 
-       if pixel == Color.new(0,0,0,0) or pixel == Color.new(255,255,255,0) 
 
- return 
 
- #除了透明像素之外, 在精灵图大小以外的地方也会判断会另一种颜色, 因此不只一种 , 则满足为不在精灵图片之上