| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 15 |  
| 积分 | 1 |  
| 经验 | 5333 |  
| 最后登录 | 2022-5-25 |  
| 在线时间 | 66 小时 |  
 Lv1.梦旅人 
	梦石0 星屑60 在线时间66 小时注册时间2011-5-25帖子73 | 
| 
本帖最后由 shoed 于 2011-8-27 16:25 编辑
x
加入我们,或者,欢迎回来。您需要 登录 才可以下载或查看,没有帐号?注册会员  
 本人感觉用RM玩脚本时总感觉非常不方便,不能实时的查看变量值的情况,
 就像是VS2005那样,可以在一个输出窗口中看到变量的变化情况,因此
 整了个简单的实时查看脚本,代码不复杂,个人感觉还是蛮方便的,但
 是现在只能查看单个变量的情况,也算是个Bug吧~~~
 
 先上图:
 
   
 脚本:
 使用方法也很简单:复制代码#--------------------------------------------------------------------------
# ● 调试模板ver1.00
# 制作者  小飞侠_shoed
# 用法:
# Debug::OutPutDebugString("map_x",map_x)
# 参数1:调试的变量名  参数2:调试的变量
#--------------------------------------------------------------------------
module Debug
  @@debug_win={}
  @@win_x=0
  @@win_y=0
  @@win_wid=160
  @@win_hei=36*2+32
  
  def Debug.OutPutDebugString(name,variable)
    if @@debug_win.include?(name)
      @@debug_win[name].refresh(name,variable)
    else
      @@win_x=@@debug_win.size%4*@@win_wid
      @@win_y=@@debug_win.size/4*@@win_hei
      @@debug_win[name]=Debug_Window.new(@@win_x,@@win_y,@@win_wid,@@win_hei,name,variable)
      @@debug_win[name].z=9999
    end
  end
  
  class Debug_Window <Window_Base
    
    def initialize(cx,cy,cw,ch,me,str)
      super(cx, cy, cw, ch)
      @variable=[]
      @variable[0]="---"
      @variable[1]=str
      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.font.size = 32
      refresh("---","---")
    end
    
    def refresh(me,str)
      if me!="---" and @variable[1] != str
        @variable.shift
        @variable.push(str)
      end
      self.contents.clear
      self.contents.font.color = Color.new(255,255,0,255)
      self.contents.draw_text(0, 2, width-32, 32, "#{me} : #{@variable[0]}")
      self.contents.font.color = Color.new(255,0,0,255)
      self.contents.draw_text(0, 38, width-32, 32, "#{me} : #{@variable[1]}")
    end
  end
end
Debug::OutPutDebugString("主角_X",$game_player.x)
 Debug::OutPutDebugString("主角_Y",$game_player.y)
 
 第一个参数你可以随意,只要自已认识就行,第二个参数就是变量了
 这个函数可以放在while的循环中,也可以放在只执行一次的初始化中,基本没限制
 呵呵,功能还很简单。。。
 | 
 |