Project1

标题: 关于鼠标定位的脚本问题 [打印本页]

作者: 邱小谦    时间: 2016-3-16 21:18
标题: 关于鼠标定位的脚本问题
本帖最后由 邱小谦 于 2016-3-16 21:19 编辑

        # X坐标,Y坐标,数量,格子宽度,格子高度,每行数目,总宽度,总长度,间隔
                @area = Area.new(14,271,14,42,42,14,451,465,35)
        end
        def update
                @叉号.update
                if @叉号.pressed or Mouse.trigger?(Mouse::RIGHT)
                        $ext = true
                end
                #获取鼠标坐标
                mouse_x, mouse_y = Mouse.get_mouse_pos
                if mouse_x>14 and mouse_x<214 and mouse_y>271 and mouse_y<471
                        if @num != @area.count
                                @num = @area.count
                                if @num !=0 and @data[@num-1]
                                        @x = 14+(@num-1)%7*60+80
                                        @y = 271+(@num-1)/7*78+30
                                        @name = @data[@num-1].name
                                        @cost = @data[@num-1].sp_cost
                                        @description = @data[@num-1].description
                                        refresh
                                else
                                        if @back and @Edge and @back.visible = true
                                                @text.bitmap.clear
                                                @back.visible = @edge.visible = false
                                        end
                                end
                        end
请教一下大神。。。我想用鼠标定位在屏幕的某一个点就出现说明框。但是怎么调试xy都没用。。。就想知道,怎么样调试呢




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1