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

Project1

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

[已经解决] 求头上名字、城镇名字、对话框的三个脚本

 关闭 [复制链接]
头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
14 小时
注册时间
2009-7-25
帖子
92
跳转到指定楼层
1
发表于 2009-7-31 11:19:17 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽

Lv1.梦旅人

~琉璃の雪~<

梦石
0
星屑
49
在线时间
36 小时
注册时间
2008-11-6
帖子
3678
2
发表于 2009-7-31 11:22:34 | 只看该作者
本帖最后由 夏季冰川 于 2009-7-31 13:04 编辑

以下是这3个脚本:
  1. #==============================================================================
  2. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  3. #==============================================================================


  4. #==============================================================================
  5. # ■ 地图名显示脚本
  6. #     by Yuee
  7. #------------------------------------------------------------------------------
  8. # 在Main的上方插入一个页,将本脚本复制到那页中即可
  9. #==============================================================================

  10. #==============================================================================
  11. # ■ Window_MapName
  12. #------------------------------------------------------------------------------
  13. #  显示地图名字的窗口。
  14. #==============================================================================

  15. class Window_MapName < Window_Base
  16.   #--------------------------------------------------------------------------
  17.   # ● 类常量定义
  18.   #--------------------------------------------------------------------------

  19.   # 暂时屏蔽用的开关
  20.   SWITCH = 35
  21.   
  22.   # 窗口位置设定
  23.   NAME_X = 450      # 矩形左上顶点X坐标
  24.   NAME_Y = 5       # 矩形左上顶点Y坐标
  25.   NAME_W = 150      # 矩形宽
  26.   NAME_H = 60       # 矩形高
  27.   
  28.   # 显示时间设置
  29.   SHOW_TIME_0 = 0  # 地图名出现前等待的帧数
  30.   SHOW_TIME_1 = 10  # 地图名从不可见变成可见的帧数
  31.   SHOW_TIME_2 = 34  # 地图名完全可见的帧数
  32.   SHOW_TIME_3 = 16  # 地图名从可见变成不可见的帧数
  33.   
  34.   # 完全可见时的透明度设置
  35.   OPACITY_1 = 255   # 边框
  36.   OPACITY_2 = 160  # 背景
  37.   OPACITY_3 = 255   # 文字
  38.   
  39.   # 地图名字的颜色
  40.   TEXT_COLOR = Color.new(255, 255, 255, 255)
  41.    
  42.   #--------------------------------------------------------------------------
  43.   # ● 初始化状态
  44.   #--------------------------------------------------------------------------
  45.   def initialize
  46.     super(NAME_X , NAME_Y, NAME_W, NAME_H)
  47.     # 初始化窗口透明度
  48.     self.opacity = 0
  49.     self.back_opacity = 0
  50.     self.contents_opacity = 0
  51.     self.contents = Bitmap.new(width - 32, height - 32)
  52.     # 剩余帧数初始化
  53.     @show_time = 0
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ● 输出文字
  57.   #--------------------------------------------------------------------------
  58.   def setname   
  59.     unless $game_switches[SWITCH]==true
  60.       # 获取地图ID
  61.       newid = $game_map.map_id
  62.       time = SHOW_TIME_1 + SHOW_TIME_2 + SHOW_TIME_3  
  63.       # 如果现在的地图的ID不是刚才显示的地图ID则开始显示
  64.       if newid != @id
  65.         @id = newid
  66.         @show_time = SHOW_TIME_0 + SHOW_TIME_1 + SHOW_TIME_2 + SHOW_TIME_3
  67.       # 剩余帧数为0是时,全部窗口透明
  68.       elsif @show_time < 1
  69.         self.opacity = 0
  70.         self.back_opacity = 0
  71.         self.contents_opacity = 0
  72.         return
  73.       end      
  74.       self.contents.clear
  75.       self.contents.font.color = TEXT_COLOR
  76.       # 描绘地图名
  77.       self.contents.draw_text(4, 0 , width - 40, 32, $data_mapinfos[@id].name, 1)
  78.       # 根本帧数设定窗口透明度
  79.       if @show_time > (SHOW_TIME_2 + SHOW_TIME_3)
  80.         self.opacity = @show_time < time ? (((OPACITY_1 / SHOW_TIME_1) * (time - @show_time)).to_i) : 0
  81.         self.back_opacity = @show_time < time ? (((OPACITY_2 / SHOW_TIME_1 )* (time - @show_time)).to_i) : 0
  82.         self.contents_opacity = @show_time < time ? (((OPACITY_3 / SHOW_TIME_1) * (time - @show_time)).to_i) : 0
  83.       else
  84.         self.opacity = @show_time < (SHOW_TIME_3 / 16 * 14) ? ((OPACITY_1 / SHOW_TIME_3) * @show_time).to_i : OPACITY_1
  85.         self.back_opacity = @show_time < (SHOW_TIME_3 / 16 * 9) ? ((OPACITY_2 / SHOW_TIME_3) * @show_time).to_i : OPACITY_2
  86.         self.contents_opacity = @show_time < SHOW_TIME_3 ? ((OPACITY_3 / SHOW_TIME_3)* @show_time).to_i : OPACITY_3
  87.       end      
  88.       @show_time -= 1
  89.     end
  90.   end
  91. end

  92. #==============================================================================
  93. # ■ Scene_Map
  94. #------------------------------------------------------------------------------
  95. #  处理地图画面的类。(追加定义)
  96. #==============================================================================

  97. class Scene_Map
  98.   alias smn_main main
  99.   def main
  100.     @mapname = Window_MapName.new
  101.     smn_main
  102.     @mapname.dispose
  103.   end
  104.   
  105.   alias smn_update update
  106.   def update
  107.     @mapname.setname
  108.     smn_update
  109.   end
  110. end

  111. #==============================================================================
  112. # ■ Scene_Title
  113. #------------------------------------------------------------------------------
  114. #  处理标题画面的类。(追加定义)
  115. #==============================================================================

  116. class Scene_Title
  117.   alias smn_main main
  118.   def main
  119.     # 读取地图信息文件
  120.     $data_mapinfos = load_data("Data/MapInfos.rxdata")
  121.     smn_main
  122.   end
  123. end

  124. #==============================================================================
  125. # 本脚本来自[url]www.66RPG.com[/url],使用和转载请保留此信息
  126. #==============================================================================




  127. NPC名:
  128. #==============================================================================
  129. # 本脚本来自[url]www.66rpg.com[/url],转载、使用请保留此信息
  130. #==============================================================================
  131. # 作者:柳柳
  132. #
  133. # 使用方法:插入到main前即可,之后就会显示每个事件的名字。
  134. # 不想显示名字的NPC直接把名字设置为一个空格就行了。
  135. #
  136. # 附加功能:名字颜色区分:比如一个NPC的名字是  柳柳,2  就会用2号颜色(红色)显示
  137. #
  138. # 修改NPC名的方法:$game_map.events[事件ID编号].name =
  139. # 比如某个宝箱,原名宝箱,打开后名为“打开的宝箱”,则
  140. # $game_map.events[@event_id].name = "打开的宝箱" 或者
  141. # $game_map.events[2].name = "打开的宝箱" (假设宝箱是2号事件)
  142. #
  143. # 修改颜色定义:70-88行,131-149行,自己随便改。
  144. #
  145. # 给主角带上名字:192行,改 "" 为 "主角" 或者 $game_party.actors[0].name 即可
  146. #
  147. # 是否显示姓名的开关:157行,开头的井号去掉。则以后39号开关打开的时候才会显示姓名
  148. #
  149. #==============================================================================
  150. # ■ Game_Event
  151. #------------------------------------------------------------------------------
  152. #  处理事件的类。条件判断、事件页的切换、并行处理、执行事件功能
  153. # 在 Game_Map 类的内部使用。
  154. #==============================================================================
  155. class Game_Event < Game_Character
  156. #——————————————————————————————————————
  157. # 用来返回名称
  158. #——————————————————————————————————————
  159. def name
  160.    return @event.name
  161. end  
  162. def name=(newname)
  163.    @event.name = newname
  164. end
  165. end

  166. #==============================================================================
  167. # ■ Sprite_Character
  168. #------------------------------------------------------------------------------
  169. #  角色显示用脚本。监视 Game_Character 类的实例、
  170. # 自动变化脚本状态。
  171. #==============================================================================

  172. class Sprite_Character < RPG::Sprite
  173. #--------------------------------------------------------------------------
  174. # ● 定义实例变量
  175. #--------------------------------------------------------------------------
  176. attr_accessor :character                # 角色
  177.    #--------------------------------------------------------------------------
  178. # ● 初始化对像
  179. #     viewport  : 查看端口
  180. #     character : 角色 (Game_Character)
  181. #--------------------------------------------------------------------------
  182. def initialize(viewport, character = nil)
  183.    name = character.name
  184.    super(viewport)
  185.    @character = character
  186.    @namesprite = Sprite.new
  187.    @namesprite.bitmap = Bitmap.new(160, 48)
  188.    @namesprite.bitmap.font.name = "黑体"
  189.    @namesprite.bitmap.font.size = 16
  190.    @namesprite.bitmap.font.color.set(255, 255, 255)
  191.    @evname = name
  192.    @evname_split = name.split(/,/)[0]
  193.    if name[0, 2]=="EV"
  194.      @evname_split = " "
  195.    end
  196.    if name.split(/,/)[1] != nil
  197.      case name.split(/,/)[1]
  198.      when "0"
  199.        @namesprite.bitmap.font.color.set(255, 255, 255)
  200.      when "1"
  201.        @namesprite.bitmap.font.color.set(128, 128, 255)
  202.      when "2"
  203.        @namesprite.bitmap.font.color.set(255, 128, 128)
  204.      when "3"
  205.        @namesprite.bitmap.font.color.set(128, 255, 128)
  206.      when "4"
  207.        @namesprite.bitmap.font.color.set(128, 255, 255)
  208.      when "5"
  209.        @namesprite.bitmap.font.color.set(255, 128, 255)
  210.      when "6"
  211.        @namesprite.bitmap.font.color.set(255, 255, 128)
  212.      when "7"
  213.        @namesprite.bitmap.font.color.set(192, 192, 192)
  214.      else
  215.        @namesprite.bitmap.font.color.set(255, 255, 255)
  216.      end
  217.    end
  218.    if @evname_split != "" and @evname_split != nil
  219.      @namesprite.bitmap.draw_text(0, 0, 160, 36, @evname_split, 1)
  220.    end
  221.    update
  222. end
  223.    #--------------------------------------------------------------------------
  224. # ● 更新画面
  225. #--------------------------------------------------------------------------
  226. def update
  227.    super
  228.    # 元件 ID、文件名、色相与现在的情况存在差异的情况下
  229.    if @tile_id != @character.tile_id or
  230.       @character_name != @character.character_name or
  231.       @character_hue != @character.character_hue
  232.      # 记忆元件 ID 与文件名、色相
  233.      @tile_id = @character.tile_id
  234.      @character_name = @character.character_name
  235.      @character_hue = @character.character_hue
  236.      # 元件 ID 为有效值的情况下
  237.      if @tile_id >= 384
  238.        self.bitmap = RPG::Cache.tile($game_map.tileset_name,
  239.          @tile_id, @character.character_hue)
  240.        self.src_rect.set(0, 0, 32, 32)
  241.        self.ox = 16
  242.        self.oy = 32
  243.      # 元件 ID 为无效值的情况下
  244.      else
  245.        self.bitmap = RPG::Cache.character(@character.character_name,
  246.          @character.character_hue)
  247.        @cw = bitmap.width / 4
  248.        @ch = bitmap.height / 4
  249.        self.ox = @cw / 2
  250.        self.oy = @ch
  251.      end
  252.    end
  253.    if @evname != @character.name
  254.      @namesprite.bitmap.clear
  255.      @evname = @character.name
  256.      @evname_split = @character.name.split(/,/)[0]
  257.      if @character.name.split(/,/)[1] != nil
  258.        case @character.name.split(/,/)[1]
  259.        when "0"
  260.          @namesprite.bitmap.font.color.set(255, 255, 255)
  261.        when "1"
  262.          @namesprite.bitmap.font.color.set(128, 128, 255)
  263.        when "2"
  264.          @namesprite.bitmap.font.color.set(255, 128, 128)
  265.        when "3"
  266.          @namesprite.bitmap.font.color.set(128, 255, 128)
  267.        when "4"
  268.          @namesprite.bitmap.font.color.set(128, 255, 255)
  269.        when "5"
  270.          @namesprite.bitmap.font.color.set(255, 128, 255)
  271.        when "6"
  272.          @namesprite.bitmap.font.color.set(255, 255, 128)
  273.        when "7"
  274.          @namesprite.bitmap.font.color.set(192, 192, 192)
  275.        else
  276.          @namesprite.bitmap.font.color.set(255, 255, 255)
  277.        end
  278.      end
  279.      if @evname_split != "" and @evname_split != nil
  280.        @namesprite.bitmap.draw_text(0, 0, 160, 36, @evname_split, 1)
  281.      end
  282.    end
  283.    @namesprite.x = self.x-80
  284.    @namesprite.y = self.y-self.oy-24
  285.    #@namesprite.visible = $game_switches[2]
  286.    # 设置可视状态
  287.    self.visible = (not @character.transparent)
  288.    # 图形是角色的情况下
  289.    if @tile_id == 0
  290.      # 设置传送目标的矩形
  291.      sx = @character.pattern * @cw
  292.      sy = (@character.direction - 2) / 2 * @ch
  293.      self.src_rect.set(sx, sy, @cw, @ch)
  294.    end
  295.    # 设置脚本的坐标
  296.    self.x = @character.screen_x
  297.    self.y = @character.screen_y
  298.    self.z = @character.screen_z(@ch)
  299.    # 设置不透明度、合成方式、茂密
  300.    self.opacity = @character.opacity
  301.    self.blend_type = @character.blend_type
  302.    self.bush_depth = @character.bush_depth
  303.    # 动画
  304.    if @character.animation_id != 0
  305.      animation = $data_animations[@character.animation_id]
  306.      animation(animation, true)
  307.      @character.animation_id = 0
  308.    end
  309. end
  310. end
  311. #==============================================================================
  312. # ■ Game_Player
  313. #------------------------------------------------------------------------------
  314. #  处理主角的类。事件启动的判定、以及地图的滚动等功能。
  315. # 本类的实例请参考 $game_player。
  316. #==============================================================================

  317. class Game_Player < Game_Character
  318. def name
  319.    return ""
  320. end
  321. end
  322. #==============================================================================
  323. # 本脚本来自[url]www.66rpg.com[/url],转载、使用请保留此信息
  324. #==============================================================================




  325. 对话框:
  326. # ————————————————————————————————————
  327. # 本脚本来自[url]www.66rpg.com[/url],转载请保留此信息
  328. # ————————————————————————————————————
  329. #——说明
  330. #默认为一个字一个字的方式,如果需要一次全部显示,
  331. #请在游戏中使用脚本:$game_system.typing = true
  332. # 其他在对话中可以使用的功能:

  333. # \n[1]:显示1号角色的姓名
  334. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名
  335. # \name[\n[1]]:显示1号主角的姓名方框
  336. # \p[1]:对话框出现在1号事件的上方
  337. # \p[0]:主人公上方出现对话框
  338. #——————————————————使用\p功能后可以自动调整对话框大小
  339. # \>   :文字不用打字方式
  340. # \<   :文字使用打字方式
  341. # \\:显示"\"这个符号
  342. # \c[1-8]:更改颜色
  343. # \g:显示金钱窗口
  344. # \t: 显示游戏时间窗口
  345. # \v[7]:显示7号变量的值
  346. # \v[a7]:显示7号防具的名称
  347. # \v[s7]:显示7号特技的名称
  348. # \v[w7]:显示7号武器的名称
  349. # \v[i7]:显示7号道具的名称
  350. # \I   :下一行从这个位置开始
  351. # \o[123]:文字透明度改为123,模拟将死之人(汗)
  352. # \h[12]:改用12号字
  353. # \b[50]:空50象素
  354. # \L[001]:在左边显示图片“Graphics/battlers/66rpg_001_h.png”
  355. # \R[001]:在右边显示图片“Graphics/battlers/66rpg_001_h.png”
  356. # \Lk:清除左边的图像
  357. # \Rk:清除右边的图像
  358. # \A:头像及姓名框靠左排列
  359. # \a:头像及姓名框靠右排列
  360. # \M[60]:等待60帧文字直接消失
  361. # \MS[1-8]:更改文字背景颜色
  362. # \ME:恢复文字背景颜色
  363. #颜色自定义设定范围0-255
  364. #使用方法:在文章前输入如下脚本定义颜色
  365. #          $color0 = 数值
  366. #          $color1 = 数值
  367. #          $color2 = 数值
  368. #\name参数的颜色自定义设定范围0-255
  369. #使用方法:在文章前输入如下脚本定义颜色
  370. #          $ncolor0 = 数值
  371. #          $ncolor1 = 数值
  372. #          $ncolor2 = 数值
  373. # \!   :等待玩家按回车再继续
  374. #$speed :文字的打字速度设置用的,数字越大速度越慢。

  375. #============================
  376. class Game_System
  377. attr_accessor :typing
  378. alias carol3_ini initialize
  379. def initialize
  380. carol3_ini
  381. @typing = true
  382. end
  383. end
  384. #=================================#==============================================================================
  385. # ■ Window_Message
  386. #------------------------------------------------------------------------------
  387. class Window_Message < Window_Selectable
  388.   #颜色自定义用的全局变量定义
  389.   $color0 = 255
  390.   $color1 = 255
  391.   $color2 = 255
  392.   #颜色自定义用的全局变量定义
  393.   
  394.   #说话速度设置用的全局变量
  395.   
  396.   $speed = 1
  397.   
  398. #--------------------------------------------------------------------------
  399. # ● 初始化状态
  400. #--------------------------------------------------------------------------
  401. def initialize
  402.   super(40, 50, 820, 160)
  403.   self.contents = Bitmap.new(width - 40, height - 32)
  404.   self.visible = false
  405.   self.z = 199
  406.   @fade_in = false
  407.   @fade_out = false
  408.   @contents_showing = false
  409.   @cursor_width = 0
  410. # Start
  411.   @bflag = false
  412. # End
  413.   @autoclosetime = -1
  414.   self.active = false
  415.   self.index = -1
  416.   @opacity_text_buf = Bitmap.new(32, 32)
  417. end
  418. #--------------------------------------------------------------------------
  419. # ● 释放
  420. #--------------------------------------------------------------------------
  421. def dispose
  422.   terminate_message
  423.   $game_temp.message_window_showing = false
  424.   if @input_number_window != nil
  425.     @input_number_window.dispose
  426.   end
  427.   super
  428. end
  429. #--------------------------------------------------------------------------
  430. # ● 处理信息结束
  431. #--------------------------------------------------------------------------
  432. def terminate_message
  433.   self.active = false
  434.   self.pause = false
  435.   self.index = -1
  436.   self.contents.clear
  437.   # 清除显示中标志
  438.   @contents_showing = false
  439.   # 呼叫信息调用
  440.   if $game_temp.message_proc != nil
  441.     $game_temp.message_proc.call
  442.   end
  443.   # 清除文章、选择项、输入数值的相关变量
  444.   $game_temp.message_text = nil
  445.   $game_temp.message_proc = nil
  446.   $game_temp.choice_start = 99
  447.   $game_temp.choice_max = 0
  448.   $game_temp.choice_cancel_type = 0
  449.   $game_temp.choice_proc = nil
  450.   $game_temp.num_input_start = 99
  451.   $game_temp.num_input_variable_id = 0
  452.   $game_temp.num_input_digits_max = 0
  453.   # 开放金钱窗口
  454.   if @gold_window != nil
  455.     @gold_window.dispose
  456.     @gold_window = nil
  457.   end
  458. #Start
  459.   # ピクチャ廃棄処理
  460.   begin
  461. #      if @spgra.disposed? == false
  462.       @spgra.dispose
  463. #      end
  464. #      if @backgraphic.disposed? == false
  465.       @backgraphic.dispose
  466. #      end
  467.   rescue
  468. #      print "ピクチャが読み込めていません!"
  469.   end
  470. #End
  471.   # 开放时间窗口
  472.   if @playtime_window != nil
  473.     @playtime_window.dispose
  474.     @playtime_window = nil
  475.   end
  476.   if @name_window_frame != nil
  477.     @name_window_frame.dispose
  478.     @name_window_frame = nil
  479.   end
  480.   if @name_window_text != nil
  481.     @name_window_text.dispose
  482.     @name_window_text = nil
  483.   end
  484.   if @right_picture != nil and @right_keep == true
  485.     @right_picture.dispose
  486.   end   
  487.   if @left_picture != nil and @left_keep == true
  488.     @left_picture.dispose
  489.   end
  490.   @face_bitmap = nil
  491. end
  492. def refresh
  493.   # 初期化
  494.   self.contents.clear
  495.   self.contents.font.color = normal_color
  496.   self.contents.font.size = Font.default_size
  497.   @x = @y = @max_x = @max_y = @indent = @lines = 0
  498.   @left_keep = @right_keep = false
  499.   @face_indent = 0
  500.   @opacity = 255
  501.   @cursor_width = 0
  502.   @autoclosetime = -1
  503.   @write_speed = $speed
  504.   @write_wait = 0
  505.   @mid_stop = false
  506.   face = nil
  507.   @popchar = -2
  508.   @alignment = true
  509.   if $game_temp.choice_start == 0
  510.     @x = 8
  511.   end
  512.   if $game_temp.message_text != nil
  513.     @now_text = $game_temp.message_text
  514.     #——对齐设置
  515.     if (/\\([Aa])/.match(@now_text))!=nil then
  516.       if $1 == "A"
  517.         @alignment = true
  518.       else
  519.         @alignment = false
  520.       end
  521.       @now_text.gsub!(/\\([Aa])/) { "" }
  522.     end
  523.     #——头像设置
  524.      if (/\\([Ff])\[(.+?)\]/.match(@now_text))!=nil then
  525.        @face = $2 + "_f.png"
  526.        if $1 == "f" and $game_actors[$2.to_i] != nil
  527.          face = $game_actors[$2.to_i].battler_name + "_f.png"
  528.        end
  529.        if FileTest.exist?("Graphics/Pictures/#{face}")
  530.          @face_bitmap = Bitmap.new("Graphics/Pictures/#{face}")
  531.          if @alignment
  532.            @x = @face_indent = 128
  533.            self.contents.blt(16, 16, @face_bitmap, Rect.new(0, 0, 96, 96))
  534.          else
  535.            self.contents.blt(self.contents.width - 112, 16, @face_bitmap,
  536.              Rect.new(0, 0, 96, 96))
  537.          end
  538.        else
  539.          face = nil
  540.          @face_bitmap = nil
  541.        end
  542.        @now_text.gsub!(/\\([Ff])\[(.*?)\]/) { "" }
  543.      end
  544.     #——左半身像设置
  545.     if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
  546.       @face = "66rpg_" + $1 + "_h.png"
  547.       if $加密 == true
  548.         if @left_picture != nil
  549.           @left_picture.dispose
  550.         end
  551.         @left_picture = Sprite.new
  552.         @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  553.         @left_picture.y = [email]480-@left_picture.bitmap.height[/email]
  554.         @left_picture.x = 0
  555.         @left_picture.mirror = true
  556.         @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  557.       else         
  558.         if FileTest.exist?("Graphics/battlers/#{@face}")
  559.           if @left_picture != nil
  560.             @left_picture.dispose
  561.           end
  562.           @left_picture = Sprite.new
  563.           @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  564.           @left_picture.y = [email]480-@left_picture.bitmap.height[/email]
  565.           @left_picture.x = 0
  566.           @left_picture.mirror = true
  567.           @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  568.         end
  569.       end        
  570.     end
  571.     #——右半身像设置
  572.     if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  573.       @face = "66rpg_" + $1 + "_h.png"
  574.       if $加密 == true
  575.         if @right_picture != nil
  576.           @right_picture.dispose
  577.         end
  578.         @right_picture = Sprite.new
  579.         @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  580.         @right_picture.y = [email]480-@right_picture.bitmap.height[/email]
  581.         @right_picture.x = [email]640-@right_picture.bitmap.width[/email]
  582.         @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  583.       else
  584.         if FileTest.exist?("Graphics/battlers/#{@face}")
  585.           if @right_picture != nil
  586.             @right_picture.dispose
  587.           end
  588.           @right_picture = Sprite.new
  589.           @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  590.           @right_picture.y = [email]480-@right_picture.bitmap.height[/email]
  591.           @right_picture.x = [email]640-@right_picture.bitmap.width[/email]
  592.           @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  593.         end
  594.       end
  595.     end
  596.     if (/\\[Rr]k/.match(@now_text)) != nil
  597.       @right_keep = true
  598.       @now_text.sub!(/\\[Rr]k/) { "" }
  599.     end
  600.     if (/\\[Ll]k/.match(@now_text)) != nil
  601.       @left_keep = true
  602.       @now_text.sub!(/\\[Ll]k/) { "" }
  603.     end
  604.     # 替换人物姓名
  605.     @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  606.       $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  607.     end
  608.     # 显示人物姓名
  609.     name_window_set = false
  610.     if (/\\[Nn][Aa][Mm][Ee](.*?)\[(.+?)\]/.match(@now_text)) != nil
  611.       name_window_set = true
  612.       name_text = $2
  613.       @now_text.sub!(/\\[Nn][Aa][Mm][Ee](.*?)\[(.*?)\]/) { "" }
  614.     end
  615.     # 文字位置的判定
  616.     if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
  617.       @popchar = $1.to_i
  618.       if @popchar == -1
  619.         @x = @indent = 48
  620.         @y = 4
  621.       end
  622.       @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  623.     end
  624.    
  625.     # 开始
  626.     begin
  627.       last_text = @now_text.clone
  628.       @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  629.     end until @now_text == last_text
  630.   @now_text.gsub!(/\\\\/) { "\000" }
  631.   @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  632.   @now_text.gsub!(/\\[Gg]/) { "\002" }
  633.   @now_text.gsub!(/\\[Tt]/) { "\004" }
  634.   @now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) { "\050[#{$1}]" }
  635.   @now_text.gsub!(/\\[Ii]/) { "\023" }
  636.   @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  637.   @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  638.   @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  639.   @now_text.gsub!(/\\[Dd]\[([0-9]+)\]/) { "\027[#{$1}]" }
  640.   @now_text.gsub!(/\\[!]/) { "\020" }
  641. @now_text.gsub!(/\\[>]/) { "\016" }
  642. @now_text.gsub!(/\\[<]/) { "\017" }

  643. # Start
  644. # ◎
  645.     # "\\MS" を "\052" に、 "\\ME" を "\053" に変更
  646.     @now_text.gsub!(/\\[Mm][Ss]\[([0-9]+)\]/) { "\052[#{$1}]" }
  647.     @now_text.gsub!(/\\[Mm][Ee]/) { "\053" }
  648. # ◎
  649. # End

  650.   if @popchar >= 0
  651.     @text_save = @now_text.clone
  652.     @max_x = 0
  653.     @max_y = 4
  654.     for i in 0..3
  655.       line = @now_text.split(/\n/)[3-i]
  656.       @max_y -= 1 if line == nil and @max_y <= 4-i
  657.       next if line == nil
  658.       cx = contents.text_size(line).width
  659.       @max_x = cx if cx > @max_x
  660.     end
  661.     self.width = @max_x + 48 + @face_indent
  662.     self.height = (@max_y - 1) * 32 + 64
  663.   else
  664.     @max_x = self.width - 32 - @face_indent
  665.   end
  666.   reset_window
  667.     if name_window_set
  668.       off_x = 0
  669.       off_y = -40
  670.       space = 2
  671.       w = self.contents.text_size(name_text).width + 26 + space
  672.       x = @alignment ? self.x + off_x - space / 2 : self.x + off_x - space / 2 + self.width - w
  673.       y = self.y + off_y - space / 2
  674.       h = 40 + space
  675.       @name_window_frame = Window_Frame.new(x, y, w, h)
  676.       @name_window_frame.z = self.z + 1
  677.       x = @alignment ? self.x + off_x - space / 2 + 4 : self.x + off_x - space / 2 + 4 + self.width - w
  678.       y = self.y + off_y - space / 2
  679.       @name_window_text = Air_Text.new(x+4, y+6, name_text)
  680.       @name_window_text.z = self.z + 2
  681.     end
  682.   end
  683.   reset_window
  684.   if $game_temp.choice_max > 0
  685.     @item_max = $game_temp.choice_max
  686.     self.active = true
  687.     self.index = 0
  688.   end
  689.   if $game_temp.num_input_variable_id > 0
  690.     digits_max = $game_temp.num_input_digits_max
  691.     number = $game_variables[$game_temp.num_input_variable_id]
  692.     @input_number_window = Window_InputNumber.new(digits_max)
  693.     @input_number_window.number = number
  694.     @input_number_window.x = self.x + 8
  695.     @input_number_window.y = self.y + $game_temp.num_input_start * 32
  696.   end
  697. end
  698. #--------------------------------------------------------------------------
  699. # ● 更新
  700. #--------------------------------------------------------------------------
  701. def update
  702.   super
  703.     if @autoclosetime == 0
  704.     @autoclosetime = -1
  705.     terminate_message
  706. end
  707.   if @autoclosetime >= 1
  708.     @autoclosetime -= 1
  709.   end
  710.   if @fade_in
  711.     self.contents_opacity += 24
  712.     if @input_number_window != nil
  713.       @input_number_window.contents_opacity += 24
  714.     end
  715.     if self.contents_opacity == 255
  716.       @fade_in = false
  717.     end
  718.     return
  719.   end
  720.   @now_text = nil if @now_text == ""
  721.   
  722.   if @now_text != nil and @mid_stop == false
  723.     if @write_wait > 0
  724.       @write_wait -= 1
  725.       return
  726.     end
  727.     text_not_skip = $game_system.typing
  728.     while true
  729.       @max_x = @x if @max_x < @x
  730.       @max_y = @y if @max_y < @y
  731.       if (c = @now_text.slice!(/./m)) != nil
  732.         if c == "\000"
  733.           c = "\\"
  734.         end
  735.         if c == "\001"
  736.           @now_text.sub!(/\[([0-9]+)\]/, "")
  737.           color = $1.to_i
  738.           if color >= 0 and color <= 7
  739.             self.contents.font.color = text_color(color)
  740.           end
  741.           c = ""
  742.         end
  743.         if c == "\002"
  744.           if @gold_window == nil and @popchar <= 0
  745.             @gold_window = Window_Gold.new
  746.             @gold_window.x = 560 - @gold_window.width
  747.             if $game_temp.in_battle
  748.               @gold_window.y = 192
  749.             else
  750.               @gold_window.y = self.y >= 128 ? 32 : 384
  751.             end
  752.             @gold_window.opacity = self.opacity
  753.             @gold_window.back_opacity = self.back_opacity
  754.           end
  755.           c = ""
  756.         end
  757.       if c == "\004"
  758.         if @playtime_window == nil and @popchar <=0
  759.           @playtime_window = Window_PlayTime.new
  760.           @playtime_window.x = 80
  761.           if $game_temp.in_battle
  762.             @playtime_window.y = 192
  763.           else
  764.             @playtime_window.y = self.y >= 128 ? 32 : 384
  765.           end
  766.           @playtime_window.opacity = self.opacity
  767.           @playtime_window.back_opacity = self.back_opacity
  768.         end
  769.       end
  770.        if c == "\016"
  771.          text_not_skip = false
  772.          c = ""
  773.        end
  774.        if c == "\017"
  775.          text_not_skip = true
  776.          c = ""
  777.        end
  778.        if c == "\020"
  779.          @mid_stop = true
  780.          c = ""
  781.        end        
  782.         if c == "\023"
  783.           @indent = @x
  784.           c = ""
  785.         end
  786.         if c == "\024"
  787.           @now_text.sub!(/\[([0-9]+)\]/, "")
  788.           @opacity = $1.to_i
  789.           c = ""
  790.         end
  791.         if c == "\025"
  792.           @now_text.sub!(/\[([0-9]+)\]/, "")
  793.           self.contents.font.size = [[$1.to_i, 6].max, 32].min
  794.           c = ""
  795.         end
  796.         if c == "\026"
  797.           @now_text.sub!(/\[([0-9]+)\]/, "")
  798.           @x += $1.to_i
  799.           c = ""
  800.         end
  801.       if c == "\027"
  802.         @now_text.sub!(/\[([0-9]+)\]/, "")
  803.         @x += $1.to_i * self.contents.font.size / 2
  804.         next
  805.       end
  806.         if c == "\030"
  807.           @now_text.sub!(/\[(.*?)\]/, "")
  808.           self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  809.           @x += 24
  810.           c = ""
  811.         end
  812.         if c == "\050"
  813.         @now_text.sub!(/\[([0-9]+)\]/, "")
  814.         @autoclosetime = $1.to_i
  815.         next
  816.       end
  817. # Start
  818. # ◎
  819.       # \MSの場合
  820.       if c == "\052"
  821.         @now_text.sub!(/\[([0-9]+)\]/, "")
  822.         bcolor = $1.to_i
  823.         @bflag = true
  824.       end
  825.       # \MEの場合
  826.       if c == "\053"
  827.         @bflag = false
  828.         bcolor = 0
  829.       end
  830. # ◎
  831. # End
  832. # Start
  833. # ◎
  834.       if @bflag == true
  835.         if bcolor >= 0 and bcolor <= 7
  836.           bsize = self.contents.text_size(c).width
  837.           self.contents.fill_rect(4 + @x, 32 * @y, bsize, 32, text_color(bcolor))
  838.         end
  839.       end
  840. # ◎
  841. # End
  842.         if c == "\n"
  843.           if @lines >= $game_temp.choice_start
  844.             @cursor_width = [@cursor_width, @max_x - @face_indent].max
  845.           end
  846.           @lines += 1
  847.           @y += 1
  848.           @x = 0 + @indent + @face_indent
  849.           if @lines >= $game_temp.choice_start
  850.             @x = 8 + @indent + @face_indent
  851.           end
  852.           c = ""
  853.         end
  854.         if c != ""
  855.           # 文字描画
  856.           @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)
  857.         end
  858.         if Input.press?(Input::B) and $game_switches[93] == false
  859.           text_not_skip = false
  860.         end
  861.       else
  862.         text_not_skip = true
  863.         break
  864.       end
  865.       # 終了判定
  866.       if text_not_skip
  867.         break
  868.       end
  869.     end
  870.     @write_wait += @write_speed
  871.     return
  872.   end
  873.   if @input_number_window != nil
  874.     @input_number_window.update
  875.     # 決定
  876.    
  877.    
  878.    if Input.trigger?(Input::C) and $game_switches[93] == false
  879.       
  880.       $game_system.se_play($data_system.decision_se)
  881.       $game_variables[$game_temp.num_input_variable_id] =
  882.       @input_number_window.number
  883.       $game_map.need_refresh = true
  884.       @input_number_window.dispose
  885.       @input_number_window = nil
  886.       terminate_message
  887.    
  888.   end
  889.     return
  890.   end
  891.   if @contents_showing
  892.     if $game_temp.choice_max == 0
  893.       self.pause = true
  894.     end
  895.     # 取消
  896.    
  897.    
  898.     if Input.trigger?(Input::B) and $game_switches[93] == false
  899.         
  900.       if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  901.         $game_system.se_play($data_system.cancel_se)
  902.         $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  903.         terminate_message
  904.       
  905.     end
  906.   end  
  907.     # 決定
  908.     if Input.trigger?(Input::C) and $game_switches[93] == false
  909.       if $game_temp.choice_max > 0
  910.         $game_system.se_play($data_system.decision_se)
  911.         $game_temp.choice_proc.call(self.index)
  912.       end
  913.       if @mid_stop
  914.         @mid_stop = false
  915.         return
  916.       else
  917.         terminate_message
  918.       end
  919.     end
  920.     return
  921.   end
  922.   if @fade_out == false and $game_temp.message_text != nil
  923.     @contents_showing = true
  924.     $game_temp.message_window_showing = true
  925.     refresh
  926.     Graphics.frame_reset
  927.     self.visible = true
  928.     self.contents_opacity = 0
  929.   if @input_number_window != nil
  930.     @input_number_window.contents_opacity = 0
  931.   end
  932.     @fade_in = true
  933.     return
  934.   end
  935.   if self.visible
  936.     @fade_out = true
  937.     self.opacity -= 48
  938.     if self.opacity == 0
  939.       self.visible = false
  940.       @fade_out = false
  941.       $game_temp.message_window_showing = false
  942.     end
  943.     return
  944.   end
  945. end
  946. #--------------------------------------------------------------------------
  947. # ● 获得字符
  948. #--------------------------------------------------------------------------
  949. def get_character(parameter)
  950.   case parameter
  951.   when 0
  952.     return $game_player
  953.   else
  954.     events = $game_map.events
  955.     return events == nil ? nil : events[parameter]
  956.   end
  957. end
  958. #--------------------------------------------------------------------------
  959. # ● ウィンドウの位置と不透明度の設定
  960. #--------------------------------------------------------------------------
  961. def reset_window
  962.   # 判定
  963.   if @popchar >= 0
  964.     events = $game_map.events
  965.     if events != nil
  966.       character = get_character(@popchar)
  967.       x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  968.       y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
  969.       self.x = x
  970.       self.y = y
  971.     end
  972.   elsif @popchar == -1
  973.     self.x = -4
  974.     self.y = -4
  975.     self.width = 50
  976.     self.height = 488
  977.   else
  978.     if $game_temp.in_battle
  979.        case $game_system.message_position
  980.        when 0 # 上
  981.         self.y = 16
  982.        when 1 # 中
  983.         self.y = 160
  984.        when 2 # 下
  985.         self.y = 315
  986.       case $game_system.message_position  
  987.       when 0  
  988.         self.x = 0
  989.       when 1
  990.         self.x = 180
  991.       when 2
  992.         self.x = 0
  993.       end      
  994.     end
  995.     else
  996.       case $game_system.message_position
  997.       when 0 # 上
  998.         self.y = 16
  999.       when 1 # 中
  1000.         self.y = 160
  1001.       when 2 # 下
  1002.         self.y = 315
  1003.       end
  1004.       case $game_system.message_position  
  1005.       when 0  
  1006.         self.x = 0
  1007.       when 1
  1008.         self.x = 160
  1009.       when 2
  1010.         self.x = 0
  1011.       end
  1012.       
  1013.        if @face_bitmap == nil
  1014.          self.width = 800
  1015.        else
  1016.          self.width = 800
  1017.          self.x -= 20
  1018.        end
  1019.        self.height = 170
  1020.      end
  1021.    end
  1022.   self.contents = Bitmap.new(self.width - 32, self.height - 32)
  1023.    if @face_bitmap != nil
  1024.      if @alignment
  1025.        self.contents.blt(16, 16, @face_bitmap, Rect.new(0, 0, 96, 96))
  1026.      else
  1027.        self.contents.blt(self.contents.width - 112, 16, @face_bitmap,
  1028.          Rect.new(0, 0, 96, 96))
  1029.      end
  1030.    end
  1031.    if @popchar == -1
  1032.     self.opacity = 255
  1033.     self.back_opacity = 0
  1034.   elsif $game_system.message_frame == 0
  1035.     self.opacity = 255
  1036.     self.back_opacity = 100
  1037.   else
  1038.     self.opacity = 0
  1039.     self.back_opacity = 100
  1040.   end
  1041. end
  1042. #--------------------------------------------------------------------------
  1043. # ● line_height
  1044. #--------------------------------------------------------------------------
  1045. # 返回値:行高
  1046. #--------------------------------------------------------------------------
  1047. def line_height
  1048.   return 32
  1049.   if self.contents.font.size >= 20 and self.contents.font.size <= 24
  1050.     return 32
  1051.   else
  1052.     return self.contents.font.size * 15 / 10
  1053.   end
  1054. end
  1055. #--------------------------------------------------------------------------
  1056. # ● \V 变换
  1057. #--------------------------------------------------------------------------
  1058. def convart_value(option, index)
  1059.   option == nil ? option = "" : nil
  1060.   option.downcase!
  1061.   case option
  1062.     when "i"
  1063.       unless $data_items[index].name == nil
  1064.         r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  1065.       end
  1066.     when "w"
  1067.       unless $data_weapons[index].name == nil
  1068.         r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  1069.       end
  1070.     when "a"
  1071.       unless $data_armors[index].name == nil
  1072.         r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  1073.       end
  1074.     when "s"
  1075.       unless $data_skills[index].name == nil
  1076.         r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  1077.       end
  1078.     else
  1079.     r = $game_variables[index]
  1080.   end
  1081.   r == nil ? r = "" : nil
  1082.   return r
  1083. end
  1084. #--------------------------------------------------------------------------
  1085. # ● 透過文字描画
  1086. #--------------------------------------------------------------------------
  1087. # target :描画対象。Bitmapクラスを指定。
  1088. # x :x座標
  1089. # y :y座標
  1090. # str  :描画文字列
  1091. # opacity:透過率(0~255)
  1092. # 返回値 :文字幅(@x増加値)。
  1093. #--------------------------------------------------------------------------
  1094. def opacity_draw_text(target, x, y, str,opacity)
  1095.   height = target.font.size
  1096.   width = target.text_size(str).width
  1097.   opacity = [[opacity, 0].max, 255].min
  1098.   if opacity == 255
  1099.     target.draw_text(x, y, width, height, str)
  1100.     return width
  1101.   else
  1102.     if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  1103.       @opacity_text_buf.dispose
  1104.       @opacity_text_buf = Bitmap.new(width, height)
  1105.     else
  1106.       @opacity_text_buf.clear
  1107.     end
  1108.     @opacity_text_buf.font.size = target.font.size
  1109.     @opacity_text_buf.draw_text(0, 0, width, height, str)
  1110.     target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  1111.   return width
  1112.   end
  1113. end
  1114. def ruby_draw_text(target, x, y, str,opacity)
  1115.   sizeback = target.font.size
  1116.   target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  1117.   rubysize = [rubysize, 6].max
  1118.   
  1119.   opacity = [[opacity, 0].max, 255].min
  1120.   split_s = str.split(/,/)
  1121.   
  1122.   split_s[0] == nil ? split_s[0] = "" : nil
  1123.   split_s[1] == nil ? split_s[1] = "" : nil
  1124.   
  1125.   height = sizeback + rubysize
  1126.   width = target.text_size(split_s[0]).width
  1127.   
  1128.   target.font.size = rubysize
  1129.   ruby_width = target.text_size(split_s[1]).width
  1130.   target.font.size = sizeback
  1131.   
  1132.   buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  1133.   
  1134.   width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  1135.   
  1136.   if opacity == 255
  1137.     target.font.size = rubysize
  1138.     target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  1139.     target.font.size = sizeback
  1140.     target.draw_text(x, y, width, target.font.size, split_s[0])
  1141.     return width
  1142.   else
  1143.     if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  1144.       @opacity_text_buf.dispose
  1145.       @opacity_text_buf = Bitmap.new(buf_width, height)
  1146.     else
  1147.       @opacity_text_buf.clear
  1148.     end
  1149.     @opacity_text_buf.font.size = rubysize
  1150.     @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  1151.     @opacity_text_buf.font.size = sizeback
  1152.     @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  1153.     if sub_x >= 0
  1154.       target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  1155.     else
  1156.       target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  1157.     end
  1158.     return width
  1159.   end
  1160. end
  1161. #--------------------------------------------------------------------------
  1162. # ● 解放
  1163. #--------------------------------------------------------------------------
  1164. def dispose
  1165.   terminate_message
  1166.   if @gaiji_cache != nil
  1167.     unless @gaiji_cache.disposed?
  1168.       @gaiji_cache.dispose
  1169.     end
  1170.   end
  1171.   unless @opacity_text_buf.disposed?
  1172.     @opacity_text_buf.dispose
  1173.   end
  1174.   $game_temp.message_window_showing = false
  1175.   if @input_number_window != nil
  1176.     @input_number_window.dispose
  1177.   end
  1178.   super
  1179. end
  1180. #--------------------------------------------------------------------------
  1181. # ● 矩形更新
  1182. #--------------------------------------------------------------------------
  1183. def update_cursor_rect
  1184.   if @index >= 0
  1185.     n = $game_temp.choice_start + @index
  1186.     self.cursor_rect.set(4 + @indent + @face_indent, n * 32 + 4, @cursor_width, 32)
  1187.   else
  1188.     self.cursor_rect.empty
  1189.   end
  1190. end
  1191. end
  1192. #==============================================================================
  1193. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  1194. #==============================================================================
  1195. class Window_Frame < Window_Base
  1196. #--------------------------------------------------------------------------
  1197. # ● オブジェクト初期化
  1198. #--------------------------------------------------------------------------
  1199. def initialize(x, y, width, height)
  1200.   super(x, y, width, height)
  1201.   self.contents = nil
  1202.   self.back_opacity = 100
  1203. end
  1204. #--------------------------------------------------------------------------
  1205. # ● 解放
  1206. #--------------------------------------------------------------------------
  1207. def dispose
  1208.   super
  1209.   end
  1210. end
  1211. #==============================================================================
  1212. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  1213. #==============================================================================
  1214. class Air_Text < Window_Base


  1215.   #参数的颜色自定义设定范围0-255
  1216.   $ncolor0 = 255
  1217.   $ncolor1 = 255
  1218.   $ncolor2 = 255
  1219.   #参数的颜色自定义设定范围0-255
  1220.   
  1221. #--------------------------------------------------------------------------
  1222. # ● オブジェクト初期化
  1223. #--------------------------------------------------------------------------
  1224. def initialize(x, y, designate_text)
  1225.   super(x-16, y-16, 32 + designate_text.size * 12, 56)
  1226.   self.opacity = 0
  1227.   self.back_opacity = 0
  1228.   self.contents = Bitmap.new(self.width - 50, self.height - 32)
  1229.   w = self.contents.width
  1230.   h = self.contents.height

  1231.   
  1232.     #颜色自定义设定范围0-255
  1233.     self.contents.font.color = Color.new($ncolor0, $ncolor1, $ncolor2)
  1234.     #颜色自定义设定范围0-255

  1235.    
  1236.    
  1237. #    self.contents.font.color = text_color(color)
  1238.   self.contents.draw_text(0, 0, w, h, designate_text)
  1239. end
  1240. #--------------------------------------------------------------------------
  1241. # ● 解放
  1242. #--------------------------------------------------------------------------
  1243. def dispose
  1244.   self.contents.clear
  1245.   super
  1246. end
  1247. end
复制代码
~现在开始自绘头像~
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
14 小时
注册时间
2009-7-25
帖子
92
3
 楼主| 发表于 2009-7-31 11:36:39 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2009-7-21
帖子
20
4
发表于 2009-7-31 11:38:13 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
54
在线时间
36 小时
注册时间
2006-6-13
帖子
237
5
发表于 2009-7-31 11:42:43 | 只看该作者
目前任务:学习
目前进度:没有
最新说明:MUD嘛~~自由度~

原来泥巴更容易挖坑
回复 支持 反对

使用道具 举报

Lv1.梦旅人

~琉璃の雪~<

梦石
0
星屑
49
在线时间
36 小时
注册时间
2008-11-6
帖子
3678
6
发表于 2009-7-31 12:55:59 | 只看该作者
本帖最后由 夏季冰川 于 2009-7-31 13:03 编辑
关于名字颜色的更改还不是很清楚,解释一下
冰冰有力 发表于 2009-7-31 11:36

事件名称:
      例:NPC,2
逗号后面的数字是颜色代码,打开F1就知道代码的颜色了



分割线:141行和346行.
~现在开始自绘头像~
回复 支持 反对

使用道具 举报

Lv1.梦旅人


梦石
0
星屑
89
在线时间
24 小时
注册时间
2006-5-27
帖子
11425

贵宾

7
发表于 2009-7-31 13:00:31 | 只看该作者
人名
http://rpg.blue/viewthread.php?t ... ght=NPC%2B%E5%90%8D
cfancy 发表于 2009-7-31 11:42

喂喂,那是VX的- -b
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-16 07:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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