设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1765|回复: 1
打印 上一主题 下一主题

[已经解决] 自己写的一个小脚本的问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
543 小时
注册时间
2009-7-13
帖子
63
跳转到指定楼层
1
发表于 2011-3-13 18:33:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

  1. class Scene_Map < Scene_Base
  2.   def start
  3.     @step_window = Window_Base.new(0,0,160,56)
  4.   end
  5.   
  6.   def terminate
  7.     @step_window.dispose
  8.   end
  9.   
  10.   def step_refresh
  11.     @step_window.contents.clear
  12.     @step_window.contents.draw_text(0,0,120,24,$game_party.steps,2)
  13.   end
  14.   
  15.   def update
  16.     @step_window.update
  17.     step_refresh
  18.   end
  19. end
复制代码
就是在地图上作了一个显示步数的小窗口,因为想做个限制步数的迷宫来的。
结果如果把上面这段脚本单独插一个地方的话,
Scene_Map 65行
  1. @spriteset.update
复制代码
报错

但是把它们直接放在Scene_Map里的话就没有问题……
虽然放在哪里影响都不大,但是还是好奇这个到底是什么原因。
退屈すぎ…

Lv1.梦旅人

百合乡の蕾咪

梦石
0
星屑
55
在线时间
151 小时
注册时间
2011-1-12
帖子
198
2
发表于 2011-3-13 21:38:36 | 只看该作者
  1. class Scene_Map < Scene_Base
  2.   alias :remilia_start :start
  3.   def start
  4.      remilia_start
  5.     @step_window = Window_Base.new(0,0,160,56)
  6.   end
  7.   alias :remilia_terminate :terminate
  8.   def terminate
  9.     remilia_terminate
  10.     @step_window.dispose
  11.   end
  12.   
  13.   def step_refresh
  14.     @step_window.contents.clear
  15.     @step_window.contents.draw_text(0,0,120,24,$game_party.steps,2)
  16.   end
  17.   alias :remilia_update :update
  18.   def update
  19.     remilia_update
  20.     @step_window.update
  21.     step_refresh
  22.   end
  23. end
复制代码

点评

跪谢  发表于 2011-3-13 21:45
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-29 07:01

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表