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

Project1

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

[RM脚本] 地名显示

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2 小时
注册时间
2006-9-3
帖子
61
跳转到指定楼层
1
发表于 2006-10-1 12:00:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
字显示的比较难看,自己调吧!!{/cy}

  1. class Floating_Location < Window_Base

  2.    def initialize
  3.       @map_name = get_name
  4.       @size = Win_Size.new(@map_name)
  5.       width = @size[0]
  6.       height = @size[1]
  7.       super(0, 0, width+32, height+32)
  8.       self.contents = Bitmap.new(width, height)
  9.       self.opacity = 240
  10.       self.back_opacity = 240
  11.       self.contents_opacity = 240
  12.       @frame_wait = Graphics.frame_count + 60
  13.       refresh
  14.    end

  15.    def refresh
  16.       self.contents.font.color = Color.new(217,87,0,255)
  17.       self.contents.draw_text(0, 0, @size[0]+32, @size[1], @map_name)
  18.    end

  19.    def update
  20.       if get_name != @map_name
  21.          self.dispose
  22.          return
  23.       end
  24.       if @frame_wait <= Graphics.frame_count
  25.          if self.opacity > 0
  26.             self.opacity -= 20
  27.             self.back_opacity -= 20
  28.             self.contents_opacity -= 20
  29.          else
  30.             self.dispose
  31.             return
  32.          end
  33.       end
  34.    end

  35.    def get_name
  36.       data = load_data("Data/MapInfos.rxdata")
  37.       data[$game_map.map_id].name
  38.    end

  39. end

  40. class Win_Size < Window_Base
  41.    
  42.    def initialize(text)
  43.       super(0, 0, 640, 480)
  44.       self.contents = Bitmap.new(640 - 32, 480 - 32)
  45.       @w = contents.text_size(text).width
  46.       @h = contents.text_size(text).height
  47.       self.dispose
  48.     end
  49.    
  50.    def [](value)
  51.      if value == 0
  52.        return @w
  53.      else
  54.        return @h
  55.      end
  56.    end

  57. end

  58. class Scene_Map

  59.    alias   :main_orig   :main
  60.    alias   :update_orig   :update
  61.    alias   :transfer_player_orig  :transfer_player

  62.    def main
  63.       @floating_location.dispose unless @floating_location.nil?
  64.       @floating_location = Floating_Location.new
  65.       main_orig
  66.       @floating_location.dispose unless (@floating_location.disposed? or
  67.                                          @floating_location.nil?)
  68.    end

  69.    def update
  70.       @floating_location.update unless (@floating_location.disposed? or
  71.                                         @floating_location.nil?)
  72.       update_orig
  73.    end
  74.    
  75.    def transfer_player
  76.       transfer_player_orig
  77.       @floating_location.dispose unless (@floating_location.disposed? or
  78.                                         @floating_location.nil?)
  79.       @floating_location = Floating_Location.new
  80.    end
  81. end
复制代码

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2 小时
注册时间
2006-9-3
帖子
61
2
 楼主| 发表于 2006-10-1 12:00:19 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
字显示的比较难看,自己调吧!!{/cy}

  1. class Floating_Location < Window_Base

  2.    def initialize
  3.       @map_name = get_name
  4.       @size = Win_Size.new(@map_name)
  5.       width = @size[0]
  6.       height = @size[1]
  7.       super(0, 0, width+32, height+32)
  8.       self.contents = Bitmap.new(width, height)
  9.       self.opacity = 240
  10.       self.back_opacity = 240
  11.       self.contents_opacity = 240
  12.       @frame_wait = Graphics.frame_count + 60
  13.       refresh
  14.    end

  15.    def refresh
  16.       self.contents.font.color = Color.new(217,87,0,255)
  17.       self.contents.draw_text(0, 0, @size[0]+32, @size[1], @map_name)
  18.    end

  19.    def update
  20.       if get_name != @map_name
  21.          self.dispose
  22.          return
  23.       end
  24.       if @frame_wait <= Graphics.frame_count
  25.          if self.opacity > 0
  26.             self.opacity -= 20
  27.             self.back_opacity -= 20
  28.             self.contents_opacity -= 20
  29.          else
  30.             self.dispose
  31.             return
  32.          end
  33.       end
  34.    end

  35.    def get_name
  36.       data = load_data("Data/MapInfos.rxdata")
  37.       data[$game_map.map_id].name
  38.    end

  39. end

  40. class Win_Size < Window_Base
  41.    
  42.    def initialize(text)
  43.       super(0, 0, 640, 480)
  44.       self.contents = Bitmap.new(640 - 32, 480 - 32)
  45.       @w = contents.text_size(text).width
  46.       @h = contents.text_size(text).height
  47.       self.dispose
  48.     end
  49.    
  50.    def [](value)
  51.      if value == 0
  52.        return @w
  53.      else
  54.        return @h
  55.      end
  56.    end

  57. end

  58. class Scene_Map

  59.    alias   :main_orig   :main
  60.    alias   :update_orig   :update
  61.    alias   :transfer_player_orig  :transfer_player

  62.    def main
  63.       @floating_location.dispose unless @floating_location.nil?
  64.       @floating_location = Floating_Location.new
  65.       main_orig
  66.       @floating_location.dispose unless (@floating_location.disposed? or
  67.                                          @floating_location.nil?)
  68.    end

  69.    def update
  70.       @floating_location.update unless (@floating_location.disposed? or
  71.                                         @floating_location.nil?)
  72.       update_orig
  73.    end
  74.    
  75.    def transfer_player
  76.       transfer_player_orig
  77.       @floating_location.dispose unless (@floating_location.disposed? or
  78.                                         @floating_location.nil?)
  79.       @floating_location = Floating_Location.new
  80.    end
  81. end
复制代码

Lv1.梦旅人

梦石
0
星屑
55
在线时间
20 小时
注册时间
2006-7-30
帖子
86
3
发表于 2006-10-10 20:27:36 | 只看该作者
{/dy}不错
回复 支持 反对

使用道具 举报

Lv2.观梦者

天仙

梦石
0
星屑
610
在线时间
184 小时
注册时间
2008-4-15
帖子
5023

贵宾

4
发表于 2007-2-14 17:58:57 | 只看该作者
怎麽让地名在不想出现的时候消失?
VA脚本开工中...
偷窃脚本1.0 - 已完成
回复 支持 反对

使用道具 举报

Lv1.梦旅人

秀逗の魔导士

梦石
0
星屑
50
在线时间
5 小时
注册时间
2006-10-25
帖子
2000

贵宾

5
发表于 2007-2-15 01:25:00 | 只看该作者
恩,不错~只是,怎么去掉名字的背景啊?
漂流的日子…
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2008-7-19
帖子
82
6
发表于 2008-7-22 02:29:43 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-1 18:12

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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