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

Project1

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

[已经解决] 找强人修改!!!

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2008-6-5
帖子
312
跳转到指定楼层
1
发表于 2009-8-16 14:26:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
怎么修改这个脚本中, 使用\name[李逍遥]这种效果,要把“李逍遥"这个名字调小,要怎么弄啊??
还有将这里使用的窗口素材怎么改为空啊??
  1. # ————————————————————————————————————
  2. # 本脚本来自www.66rpg.com,转载请保留此信息
  3. # ————————————————————————————————————
  4. #——说明
  5. #默认为一个字一个字的方式,如果需要一次全部显示,
  6. #请在游戏中使用脚本:$game_system.typing = true
  7. # 其他在对话中可以使用的功能:
  8. # \n[1]:显示1号角色的姓名
  9. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名
  10. # \name[\n[1]]:显示1号主角的姓名方框
  11. # \p[1]:对话框出现在1号事件的上方
  12. # \p[0]:主人公上方出现对话框
  13. #——————————————————使用\p功能后可以自动调整对话框大小
  14. # \> :文字不用打字方式
  15. # \< :文字使用打字方式
  16. # \\:显示"\"这个符号
  17. # \c[1-8]:更改颜色
  18. # \g:显示金钱窗口
  19. # \t: 显示游戏时间窗口
  20. # \v[7]:显示7号变量的值
  21. # \v[a7]:显示7号防具的名称
  22. # \v[s7]:显示7号特技的名称
  23. # \v[w7]:显示7号武器的名称
  24. # \v[i7]:显示7号道具的名称
  25. # \I :下一行从这个位置开始
  26. # \o[123]:文字透明度改为123,模拟将死之人(汗)
  27. # \h[12]:改用12号字
  28. # \b[50]:空50象素
  29. # \L[001]:在左边显示图片“Graphics/battlers/66rpg_001_h.png”
  30. # \R[001]:在右边显示图片“Graphics/battlers/66rpg_001_h.png”
  31. # \Lk:清除左边的图像
  32. # \Rk:清除右边的图像
  33. # \A:头像及姓名框靠左排列
  34. # \a:头像及姓名框靠右排列
  35. # \M[60]:等待60帧文字直接消失
  36. # \MS[1-8]:更改文字背景颜色
  37. # \ME:恢复文字背景颜色
  38. #颜色自定义设定范围0-255
  39. #使用方法:在文章前输入如下脚本定义颜色
  40. # $color0 = 数值
  41. # $color1 = 数值
  42. # $color2 = 数值
  43. #\name参数的颜色自定义设定范围0-255
  44. #使用方法:在文章前输入如下脚本定义颜色
  45. # $ncolor0 = 数值
  46. # $ncolor1 = 数值
  47. # $ncolor2 = 数值
  48. # \! :等待玩家按回车再继续
  49. #$speed :文字的打字速度设置用的,数字越大速度越慢。
  50. #============================
  51. module Messaging
  52. X = 85 # X坐标
  53. WIDTH = 480 #宽度
  54. HEIGHT = 160 #高度
  55. end
  56. class Game_System
  57. attr_accessor :typing
  58. alias carol3_ini initialize
  59. def initialize
  60. carol3_ini
  61. @typing = true
  62. end
  63. end
  64. #=================================#==============================================================================
  65. # ■ Window_Message
  66. #------------------------------------------------------------------------------
  67. class Window_Message < Window_Selectable
  68. #颜色自定义用的全局变量定义
  69. $color0 = 255
  70. $color1 = 255
  71. $color2 = 255
  72. #颜色自定义用的全局变量定义
  73. #说话速度设置用的全局变量
  74. $speed = 1
  75. #--------------------------------------------------------------------------
  76. # ● 初始化状态
  77. #--------------------------------------------------------------------------
  78. def initialize
  79. super(160, 304, 480, 160)
  80. self.contents = Bitmap.new(width - 40, height - 32)
  81. self.visible = false
  82. self.z = 199
  83. @fade_in = false
  84. @fade_out = false
  85. @contents_showing = false
  86. @cursor_width = 0
  87. # Start
  88. @bflag = false
  89. # End
  90. @autoclosetime = -1
  91. self.active = false
  92. self.index = -1
  93. @opacity_text_buf = Bitmap.new(32, 32)
  94. end
  95. #--------------------------------------------------------------------------
  96. # ● 释放
  97. #--------------------------------------------------------------------------
  98. def dispose
  99. terminate_message
  100. $game_temp.message_window_showing = false
  101. if @input_number_window != nil
  102. @input_number_window.dispose
  103. end
  104. super
  105. end
  106. #--------------------------------------------------------------------------
  107. # ● 处理信息结束
  108. #--------------------------------------------------------------------------
  109. def terminate_message
  110. self.active = false
  111. self.pause = false
  112. self.index = -1
  113. self.contents.clear
  114. # 清除显示中标志
  115. @contents_showing = false
  116. # 呼叫信息调用
  117. if $game_temp.message_proc != nil
  118. $game_temp.message_proc.call
  119. end
  120. # 清除文章、选择项、输入数值的相关变量
  121. $game_temp.message_text = nil
  122. $game_temp.message_proc = nil
  123. $game_temp.choice_start = 99
  124. $game_temp.choice_max = 0
  125. $game_temp.choice_cancel_type = 0
  126. $game_temp.choice_proc = nil
  127. $game_temp.num_input_start = 99
  128. $game_temp.num_input_variable_id = 0
  129. $game_temp.num_input_digits_max = 0
  130. # 开放金钱窗口
  131. if @gold_window != nil
  132. @gold_window.dispose
  133. @gold_window = nil
  134. end
  135. #Start
  136. # ピクチャ廃棄処理
  137. begin
  138. # if @spgra.disposed? == false
  139. @spgra.dispose
  140. # end
  141. # if @backgraphic.disposed? == false
  142. @backgraphic.dispose
  143. # end
  144. rescue
  145. # print "ピクチャが読み込めていません!"
  146. end
  147. #End
  148. # 开放时间窗口
  149. if @playtime_window != nil
  150. @playtime_window.dispose
  151. @playtime_window = nil
  152. end
  153. if @name_window_frame != nil
  154. @name_window_frame.dispose
  155. @name_window_frame = nil
  156. end
  157. if @name_window_text != nil
  158. @name_window_text.dispose
  159. @name_window_text = nil
  160. end
  161. if @right_picture != nil and @right_keep == true
  162. @right_picture.dispose
  163. end
  164. if @left_picture != nil and @left_keep == true
  165. @left_picture.dispose
  166. end
  167. @face_bitmap = nil
  168. end
  169. def refresh
  170. # 初期化
  171. self.contents.clear
  172. self.contents.font.color = normal_color
  173. self.contents.font.size = Font.default_size
  174. @x = @y = @max_x = @max_y = @indent = @lines = 0
  175. @left_keep = @right_keep = false
  176. @face_indent = 0
  177. @opacity = 255
  178. @cursor_width = 0
  179. @autoclosetime = -1
  180. @write_speed = $speed
  181. @write_wait = 0
  182. @mid_stop = false
  183. face = nil
  184. @popchar = -2
  185. @alignment = true
  186. if $game_temp.choice_start == 0
  187. @x = 8
  188. end
  189. if $game_temp.message_text != nil
  190. @now_text = $game_temp.message_text
  191. #——对齐设置
  192. if (/\\([Aa])/.match(@now_text))!=nil then
  193. if $1 == "A"
  194. @alignment = true
  195. else
  196. @alignment = false
  197. end
  198. @now_text.gsub!(/\\([Aa])/) { "" }
  199. end
  200. #——头像设置
  201. if (/\\([Ff])\[(.+?)\]/.match(@now_text))!=nil then
  202. @face = $2 + "_f.png"
  203. if $1 == "f" and $game_actors[$2.to_i] != nil
  204. face = $game_actors[$2.to_i].battler_name + "_f.png"
  205. end
  206. if FileTest.exist?("Graphics/Pictures/#{face}")
  207. @face_bitmap = Bitmap.new("Graphics/Pictures/#{face}")
  208. if @alignment
  209. @x = @face_indent = 128
  210. self.contents.blt(16, 16, @face_bitmap, Rect.new(0, 0, 96, 96))
  211. else
  212. self.contents.blt(self.contents.width - 112, 16, @face_bitmap,
  213. Rect.new(0, 0, 96, 96))
  214. end
  215. else
  216. face = nil
  217. @face_bitmap = nil
  218. end
  219. @now_text.gsub!(/\\([Ff])\[(.*?)\]/) { "" }
  220. end
  221. #——左半身像设置
  222. if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then
  223. @face = $1 + "_h.png"
  224. if $加密 == true
  225. if @left_picture != nil
  226. @left_picture.dispose
  227. end
  228. @left_picture = Sprite.new
  229. @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  230. @left_picture.y = 480-@left_picture.bitmap.height
  231. @left_picture.x = 0
  232. @left_picture.mirror = true
  233. @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  234. else
  235. if FileTest.exist?("Graphics/battlers/#{@face}")
  236. if @left_picture != nil
  237. @left_picture.dispose
  238. end
  239. @left_picture = Sprite.new
  240. @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  241. @left_picture.y = 480-@left_picture.bitmap.height
  242. @left_picture.x = 0
  243. @left_picture.mirror = true
  244. @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }
  245. end
  246. end
  247. end
  248. #——右半身像设置
  249. if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then
  250. @face = $1 + "_h.png"
  251. if $加密 == true
  252. if @right_picture != nil
  253. @right_picture.dispose
  254. end
  255. @right_picture = Sprite.new
  256. @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  257. @right_picture.y = 480-@right_picture.bitmap.height
  258. @right_picture.x = 640-@right_picture.bitmap.width
  259. @right_picture.z = 9999
  260. @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  261. else
  262. if FileTest.exist?("Graphics/battlers/#{@face}")
  263. if @right_picture != nil
  264. @right_picture.dispose
  265. end
  266. @right_picture = Sprite.new
  267. @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")
  268. @right_picture.y = 480-@right_picture.bitmap.height
  269. @right_picture.x = 640-@right_picture.bitmap.width
  270. @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }
  271. end
  272. end
  273. end
  274. if (/\\[Rr]k/.match(@now_text)) != nil
  275. @right_keep = true
  276. @now_text.sub!(/\\[Rr]k/) { "" }
  277. end
  278. if (/\\[Ll]k/.match(@now_text)) != nil
  279. @left_keep = true
  280. @now_text.sub!(/\\[Ll]k/) { "" }
  281. end
  282. # 替换人物姓名
  283. @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do
  284. $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""
  285. end
  286. # 显示人物姓名
  287. name_window_set = false
  288. if (/\\[Nn][Aa][Mm][Ee](.*?)\[(.+?)\]/.match(@now_text)) != nil
  289. name_window_set = true
  290. name_text = $2
  291. @now_text.sub!(/\\[Nn][Aa][Mm][Ee](.*?)\[(.*?)\]/) { "" }
  292. end
  293. # 文字位置的判定
  294. if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then
  295. @popchar = $1.to_i
  296. if @popchar == -1
  297. @x = @indent = 48
  298. @y = 4
  299. end
  300. @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }
  301. end
  302. # 开始
  303. begin
  304. last_text = @now_text.clone
  305. @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }
  306. end until @now_text == last_text
  307. @now_text.gsub!(/\\\\/) { "\000" }
  308. @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }
  309. @now_text.gsub!(/\\[Gg]/) { "\002" }
  310. @now_text.gsub!(/\\[Tt]/) { "\004" }
  311. @now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) { "\050[#{$1}]" }
  312. @now_text.gsub!(/\\[Ii]/) { "\023" }
  313. @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }
  314. @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }
  315. @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }
  316. @now_text.gsub!(/\\[Dd]\[([0-9]+)\]/) { "\027[#{$1}]" }
  317. @now_text.gsub!(/\\[!]/) { "\020" }
  318. @now_text.gsub!(/\\[>]/) { "\016" }
  319. @now_text.gsub!(/\\[<]/) { "\017" }
  320. # Start
  321. # ◎
  322. # "\\MS" を "\052" に、 "\\ME" を "\053" に変更
  323. @now_text.gsub!(/\\[Mm][Ss]\[([0-9]+)\]/) { "\052[#{$1}]" }
  324. @now_text.gsub!(/\\[Mm][Ee]/) { "\053" }
  325. # ◎
  326. # End
  327. if @popchar >= 0
  328. @text_save = @now_text.clone
  329. @max_x = 0
  330. @max_y = 4
  331. for i in 0..3
  332. line = @now_text.split(/\n/)[3-i]
  333. @max_y -= 1 if line == nil and @max_y <= 4-i
  334. next if line == nil
  335. cx = contents.text_size(line).width
  336. @max_x = cx if cx > @max_x
  337. end
  338. self.width = @max_x + 48 + @face_indent
  339. self.height = (@max_y - 1) * 32 + 64
  340. else
  341. @max_x = self.width - 32 - @face_indent
  342. end
  343. reset_window
  344. if name_window_set
  345. off_x = 0
  346. off_y = -40
  347. space = 2
  348. w = self.contents.text_size(name_text).width + 26 + space
  349. x = @alignment ? self.x + off_x - space / 2 : self.x + off_x - space / 2 + self.width - w
  350. y = self.y + off_y - space / 2
  351. h = 40 + space
  352. @name_window_frame = Window_Frame.new(x, y, w, h)
  353. @name_window_frame.z = self.z + 1
  354. x = @alignment ? self.x + off_x - space / 2 + 4 : self.x + off_x - space / 2 + 4 + self.width - w
  355. y = self.y + off_y - space / 2
  356. @name_window_text = Air_Text.new(x+4, y+6, name_text)
  357. @name_window_text.z = self.z + 2
  358. end
  359. end
  360. reset_window
  361. if $game_temp.choice_max > 0
  362. @item_max = $game_temp.choice_max
  363. self.active = true
  364. self.index = 0
  365. end
  366. if $game_temp.num_input_variable_id > 0
  367. digits_max = $game_temp.num_input_digits_max
  368. number = $game_variables[$game_temp.num_input_variable_id]
  369. @input_number_window = Window_InputNumber.new(digits_max)
  370. @input_number_window.number = number
  371. @input_number_window.x = self.x + 8
  372. @input_number_window.y = self.y + $game_temp.num_input_start * 32
  373. end
  374. end
  375. #--------------------------------------------------------------------------
  376. # ● 更新
  377. #--------------------------------------------------------------------------
  378. def update
  379. super
  380. if @autoclosetime == 0
  381. @autoclosetime = -1
  382. terminate_message
  383. end
  384. if @autoclosetime >= 1
  385. @autoclosetime -= 1
  386. end
  387. if @fade_in
  388. self.contents_opacity += 24
  389. if @input_number_window != nil
  390. @input_number_window.contents_opacity += 24
  391. end
  392. if self.contents_opacity == 255
  393. @fade_in = false
  394. end
  395. return
  396. end
  397. @now_text = nil if @now_text == ""
  398. if @now_text != nil and @mid_stop == false
  399. if @write_wait > 0
  400. @write_wait -= 1
  401. return
  402. end
  403. text_not_skip = $game_system.typing
  404. while true
  405. @max_x = @x if @max_x < @x
  406. @max_y = @y if @max_y < @y
  407. if (c = @now_text.slice!(/./m)) != nil
  408. if c == "\000"
  409. c = "\\"
  410. end
  411. if c == "\001"
  412. @now_text.sub!(/\[([0-9]+)\]/, "")
  413. color = $1.to_i
  414. if color >= 0 and color <= 7
  415. self.contents.font.color = text_color(color)
  416. end
  417. c = ""
  418. end
  419. if c == "\002"
  420. if @gold_window == nil and @popchar <= 0
  421. @gold_window = Window_Gold.new
  422. @gold_window.x = 560 - @gold_window.width
  423. if $game_temp.in_battle
  424. @gold_window.y = 192
  425. else
  426. @gold_window.y = self.y >= 128 ? 32 : 384
  427. end
  428. @gold_window.opacity = self.opacity
  429. @gold_window.back_opacity = self.back_opacity
  430. end
  431. c = ""
  432. end
  433. if c == "\004"
  434. if @playtime_window == nil and @popchar <=0
  435. @playtime_window = Window_PlayTime.new
  436. @playtime_window.x = 80
  437. if $game_temp.in_battle
  438. @playtime_window.y = 192
  439. else
  440. @playtime_window.y = self.y >= 128 ? 32 : 384
  441. end
  442. @playtime_window.opacity = self.opacity
  443. @playtime_window.back_opacity = self.back_opacity
  444. end
  445. end
  446. if c == "\016"
  447. text_not_skip = false
  448. c = ""
  449. end
  450. if c == "\017"
  451. text_not_skip = true
  452. c = ""
  453. end
  454. if c == "\020"
  455. @mid_stop = true
  456. c = ""
  457. end
  458. if c == "\023"
  459. @indent = @x
  460. c = ""
  461. end
  462. if c == "\024"
  463. @now_text.sub!(/\[([0-9]+)\]/, "")
  464. @opacity = $1.to_i
  465. c = ""
  466. end
  467. if c == "\025"
  468. @now_text.sub!(/\[([0-9]+)\]/, "")
  469. self.contents.font.size = [[$1.to_i, 6].max, 32].min
  470. c = ""
  471. end
  472. if c == "\026"
  473. @now_text.sub!(/\[([0-9]+)\]/, "")
  474. @x += $1.to_i
  475. c = ""
  476. end
  477. if c == "\027"
  478. @now_text.sub!(/\[([0-9]+)\]/, "")
  479. @x += $1.to_i * self.contents.font.size / 2
  480. next
  481. end
  482. if c == "\030"
  483. @now_text.sub!(/\[(.*?)\]/, "")
  484. self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))
  485. @x += 24
  486. c = ""
  487. end
  488. if c == "\050"
  489. @now_text.sub!(/\[([0-9]+)\]/, "")
  490. @autoclosetime = $1.to_i
  491. next
  492. end
  493. # Start
  494. # ◎
  495. # \MSの場合
  496. if c == "\052"
  497. @now_text.sub!(/\[([0-9]+)\]/, "")
  498. bcolor = $1.to_i
  499. @bflag = true
  500. end
  501. # \MEの場合
  502. if c == "\053"
  503. @bflag = false
  504. bcolor = 0
  505. end
  506. # ◎
  507. # End
  508. # Start
  509. # ◎
  510. if @bflag == true
  511. if bcolor >= 0 and bcolor <= 7
  512. bsize = self.contents.text_size(c).width
  513. self.contents.fill_rect(4 + @x, 32 * @y, bsize, 32, text_color(bcolor))
  514. end
  515. end
  516. # ◎
  517. # End
  518. if c == "\n"
  519. if @lines >= $game_temp.choice_start
  520. @cursor_width = [@cursor_width, @max_x - @face_indent].max
  521. end
  522. @lines += 1
  523. @y += 1
  524. @x = 0 + @indent + @face_indent
  525. if @lines >= $game_temp.choice_start
  526. @x = 8 + @indent + @face_indent
  527. end
  528. c = ""
  529. end
  530. if c != ""
  531. # 文字描画
  532. @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)
  533. end
  534. if Input.press?(Input::B) and $game_switches[93] == false
  535. text_not_skip = false
  536. end
  537. else
  538. text_not_skip = true
  539. break
  540. end
  541. # 終了判定
  542. if text_not_skip
  543. break
  544. end
  545. end
  546. @write_wait += @write_speed
  547. return
  548. end
  549. if @input_number_window != nil
  550. @input_number_window.update
  551. # 決定

  552. if Input.trigger?(Input::C) and $game_switches[93] == false
  553. $game_system.se_play($data_system.decision_se)
  554. $game_variables[$game_temp.num_input_variable_id] =
  555. @input_number_window.number
  556. $game_map.need_refresh = true
  557. @input_number_window.dispose
  558. @input_number_window = nil
  559. terminate_message
  560. end
  561. return
  562. end
  563. if @contents_showing
  564. if $game_temp.choice_max == 0
  565. self.pause = true
  566. end
  567. # 取消

  568. if Input.trigger?(Input::B) and $game_switches[93] == false
  569. if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
  570. $game_system.se_play($data_system.cancel_se)
  571. $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
  572. terminate_message
  573. end
  574. end
  575. # 決定
  576. if Input.trigger?(Input::C) and $game_switches[93] == false
  577. if $game_temp.choice_max > 0
  578. $game_system.se_play($data_system.decision_se)
  579. $game_temp.choice_proc.call(self.index)
  580. end
  581. if @mid_stop
  582. @mid_stop = false
  583. return
  584. else
  585. terminate_message
  586. end
  587. end
  588. return
  589. end
  590. if @fade_out == false and $game_temp.message_text != nil
  591. @contents_showing = true
  592. $game_temp.message_window_showing = true
  593. refresh
  594. Graphics.frame_reset
  595. self.visible = true
  596. self.contents_opacity = 0
  597. if @input_number_window != nil
  598. @input_number_window.contents_opacity = 0
  599. end
  600. @fade_in = true
  601. return
  602. end
  603. if self.visible
  604. @fade_out = true
  605. self.opacity -= 48
  606. if self.opacity == 0
  607. self.visible = false
  608. @fade_out = false
  609. $game_temp.message_window_showing = false
  610. end
  611. return
  612. end
  613. end
  614. #--------------------------------------------------------------------------
  615. # ● 获得字符
  616. #--------------------------------------------------------------------------
  617. def get_character(parameter)
  618. case parameter
  619. when 0
  620. return $game_player
  621. else
  622. events = $game_map.events
  623. return events == nil ? nil : events[parameter]
  624. end
  625. end
  626. #--------------------------------------------------------------------------
  627. # ● ウィンドウの位置と不透明度の設定
  628. #--------------------------------------------------------------------------
  629. def reset_window
  630. # 判定
  631. if @popchar >= 0
  632. events = $game_map.events
  633. if events != nil
  634. character = get_character(@popchar)
  635. x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min
  636. y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min
  637. self.x = x
  638. self.y = y
  639. end
  640. elsif @popchar == -1
  641. self.x = -4
  642. self.y = -4
  643. self.width = 50
  644. self.height = 488
  645. else
  646. if $game_temp.in_battle
  647. case $game_system.message_position
  648. when 0 # 上
  649. self.y = 16
  650. when 1 # 中
  651. self.y = 160
  652. when 2 # 下
  653. self.y = 315
  654. #case $game_system.message_position
  655. #when 0
  656. #self.x = 0
  657. #when 1
  658. #self.x =0
  659. #when 2
  660. #self.x = 0
  661. #end
  662. end
  663. else
  664. case $game_system.message_position
  665. when 0 # 上
  666. self.y = 16
  667. when 1 # 中
  668. self.y = 160
  669. when 2 # 下
  670. self.y = 315
  671. end
  672. #case $game_system.message_position
  673. #when 0
  674. #self.x = 0
  675. #when 1
  676. #self.x = 0
  677. #when 2
  678. #self.x = 0
  679. #end
  680. #if @face_bitmap == nil
  681. #self.width = 640
  682. #else
  683. #self.width = 640
  684. #self.x -= 20
  685. #end
  686. self.x = Messaging::X
  687. self.height = Messaging::HEIGHT
  688. self.width = Messaging::WIDTH
  689. end
  690. end
  691. self.contents = Bitmap.new(self.width - 32, self.height - 32)
  692. if @face_bitmap != nil
  693. if @alignment
  694. self.contents.blt(16, 16, @face_bitmap, Rect.new(0, 0, 96, 96))
  695. else
  696. self.contents.blt(self.contents.width - 112, 16, @face_bitmap,
  697. Rect.new(0, 0, 96, 96))
  698. end
  699. end
  700. if @popchar == -1
  701. self.opacity = 255
  702. self.back_opacity = 0
  703. elsif $game_system.message_frame == 0
  704. self.opacity = 255
  705. self.back_opacity = 100
  706. else
  707. self.opacity = 0
  708. self.back_opacity = 100
  709. end
  710. end
  711. #--------------------------------------------------------------------------
  712. # ● line_height
  713. #--------------------------------------------------------------------------
  714. # 返回値:行高
  715. #--------------------------------------------------------------------------
  716. def line_height
  717. return 32
  718. if self.contents.font.size >= 20 and self.contents.font.size <= 24
  719. return 32
  720. else
  721. return self.contents.font.size * 15 / 10
  722. end
  723. end
  724. #--------------------------------------------------------------------------
  725. # ● \V 变换
  726. #--------------------------------------------------------------------------
  727. def convart_value(option, index)
  728. option == nil ? option = "" : nil
  729. option.downcase!
  730. case option
  731. when "i"
  732. unless $data_items[index].name == nil
  733. r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)
  734. end
  735. when "w"
  736. unless $data_weapons[index].name == nil
  737. r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)
  738. end
  739. when "a"
  740. unless $data_armors[index].name == nil
  741. r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)
  742. end
  743. when "s"
  744. unless $data_skills[index].name == nil
  745. r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)
  746. end
  747. else
  748. r = $game_variables[index]
  749. end
  750. r == nil ? r = "" : nil
  751. return r
  752. end
  753. #--------------------------------------------------------------------------
  754. # ● 透過文字描画
  755. #--------------------------------------------------------------------------
  756. # target :描画対象。Bitmapクラスを指定。
  757. # x :x座標
  758. # y :y座標
  759. # str  :描画文字列
  760. # opacity:透過率(0~255)
  761. # 返回値 :文字幅(@x増加値)。
  762. #--------------------------------------------------------------------------
  763. def opacity_draw_text(target, x, y, str,opacity)
  764. height = target.font.size
  765. width = target.text_size(str).width
  766. opacity = [[opacity, 0].max, 255].min
  767. if opacity == 255
  768. target.draw_text(x, y, width, height, str)
  769. return width
  770. else
  771. if @opacity_text_buf.width < width or @opacity_text_buf.height < height
  772. @opacity_text_buf.dispose
  773. @opacity_text_buf = Bitmap.new(width, height)
  774. else
  775. @opacity_text_buf.clear
  776. end
  777. @opacity_text_buf.font.size = target.font.size
  778. @opacity_text_buf.draw_text(0, 0, width, height, str)
  779. target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)
  780. return width
  781. end
  782. end
  783. def ruby_draw_text(target, x, y, str,opacity)
  784. sizeback = target.font.size
  785. target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2
  786. rubysize = [rubysize, 6].max
  787. opacity = [[opacity, 0].max, 255].min
  788. split_s = str.split(/,/)
  789. split_s[0] == nil ? split_s[0] = "" : nil
  790. split_s[1] == nil ? split_s[1] = "" : nil
  791. height = sizeback + rubysize
  792. width = target.text_size(split_s[0]).width
  793. target.font.size = rubysize
  794. ruby_width = target.text_size(split_s[1]).width
  795. target.font.size = sizeback
  796. buf_width = [target.text_size(split_s[0]).width, ruby_width].max
  797. width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0
  798. if opacity == 255
  799. target.font.size = rubysize
  800. target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])
  801. target.font.size = sizeback
  802. target.draw_text(x, y, width, target.font.size, split_s[0])
  803. return width
  804. else
  805. if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height
  806. @opacity_text_buf.dispose
  807. @opacity_text_buf = Bitmap.new(buf_width, height)
  808. else
  809. @opacity_text_buf.clear
  810. end
  811. @opacity_text_buf.font.size = rubysize
  812. @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)
  813. @opacity_text_buf.font.size = sizeback
  814. @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)
  815. if sub_x >= 0
  816. target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  817. else
  818. target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)
  819. end
  820. return width
  821. end
  822. end
  823. #--------------------------------------------------------------------------
  824. # ● 解放
  825. #--------------------------------------------------------------------------
  826. def dispose
  827. terminate_message
  828. if @gaiji_cache != nil
  829. unless @gaiji_cache.disposed?
  830. @gaiji_cache.dispose
  831. end
  832. end
  833. unless @opacity_text_buf.disposed?
  834. @opacity_text_buf.dispose
  835. end
  836. $game_temp.message_window_showing = false
  837. if @input_number_window != nil
  838. @input_number_window.dispose
  839. end
  840. super
  841. end
  842. #--------------------------------------------------------------------------
  843. # ● 矩形更新
  844. #--------------------------------------------------------------------------
  845. def update_cursor_rect
  846. if @index >= 0
  847. n = $game_temp.choice_start + @index
  848. self.cursor_rect.set(4 + @indent + @face_indent, n * 32 + 4, @cursor_width, 32)
  849. else
  850. self.cursor_rect.empty
  851. end
  852. end
  853. end
  854. #==============================================================================
  855. # ■ Window_Frame (枠だけで中身の無いウィンドウ)
  856. #==============================================================================
  857. class Window_Frame < Window_Base
  858. #--------------------------------------------------------------------------
  859. # ● オブジェクト初期化
  860. #--------------------------------------------------------------------------
  861. def initialize(x, y, width, height)
  862. super(x, y, width, height)
  863. self.contents = nil
  864. self.back_opacity = 100
  865. end
  866. #--------------------------------------------------------------------------
  867. # ● 解放
  868. #--------------------------------------------------------------------------
  869. def dispose
  870. super
  871. end
  872. end
  873. #==============================================================================
  874. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)
  875. #==============================================================================
  876. class Air_Text < Window_Base

  877. #参数的颜色自定义设定范围0-255
  878. $ncolor0 = 255
  879. $ncolor1 = 255
  880. $ncolor2 = 255
  881. #参数的颜色自定义设定范围0-255
  882. #--------------------------------------------------------------------------
  883. # ● オブジェクト初期化
  884. #--------------------------------------------------------------------------
  885. def initialize(x, y, designate_text)
  886. super(x-16, y-16, 32 + designate_text.size * 12, 56)
  887. self.opacity = 0
  888. self.back_opacity = 0
  889. self.contents = Bitmap.new(self.width - 10, self.height - 32)
  890. w = self.contents.width
  891. h = self.contents.height

  892. #颜色自定义设定范围0-255
  893. self.contents.font.color = Color.new($ncolor0, $ncolor1, $ncolor2)
  894. #颜色自定义设定范围0-255

  895. # self.contents.font.color = text_color(color)
  896. self.contents.draw_text(0, 0, w, h, designate_text)
  897. end
  898. #--------------------------------------------------------------------------
  899. # ● 解放
  900. #--------------------------------------------------------------------------
  901. def dispose
  902. self.contents.clear
  903. super
  904. end
  905. end
复制代码

Lv3.寻梦者

小柯的徒弟

梦石
0
星屑
1535
在线时间
1157 小时
注册时间
2008-5-24
帖子
3085

贵宾

2
发表于 2009-8-16 14:34:04 | 只看该作者
本帖最后由 「旅」 于 2009-8-16 14:35 编辑

搜索——
  1. ($ncolor0, $ncolor1, $ncolor2)
复制代码
下面加入
  1. self.contents.font.size = 20
复制代码


第二个问题是什么意思,要什么效果。另外你的标题可以好点吗……
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
4 小时
注册时间
2008-6-5
帖子
312
3
 楼主| 发表于 2009-8-16 14:41:43 | 只看该作者
就是修改凸出的名字,把字体变小...(或者给个真对话脚本,主站那个不可以用.............)
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3078
在线时间
764 小时
注册时间
2008-7-5
帖子
760
4
发表于 2009-8-16 14:51:24 | 只看该作者
#--------------------------------------------------------------------------
# ● 初始化状态
#--------------------------------------------------------------------------
def initialize

  super(40, 50, 820, 160)
加入这个
self.windowskin = RPG::Cache.windowskin("")
阿姨我还未填平坑.....
自己是“擅长美工的笨蛋策划在干着程序的活”
  
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-1-10 22:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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