タッチするボタンの頂点座標が (x0,y0)(x1,y0) (x0,y1)(x1,y1) だとして、 if tm==1 && tx>=x0 && tx<=x1 && ty>=y0 && ty<=y1 then .. とすればいいです。毎回長い命令打ち込むの大変だから、 def pt_in_rect(tx,ty,x0,y0,x1,y1) return tx>=x0 && tx<=x1 && ty>=y0 && ty<=y1 end という自作関数作っておけば if tm==1 && pt_in_rect(tx,ty,x0,y0,x1,y1) then .. と書けます。