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

Project1

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

[原创发布] 【捂脸发布】发现我真的抽了。。

[复制链接]

Lv1.梦旅人

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

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

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

x
我真的抽风了。。。
中午没事的时候继续弄游戏啦,,用的是内个最经典的【对话框加强脚本】,功能挺多的,够用了。只是只是,,唉唉那功能代码一大堆。。什么【\L】、【\R】、【\F】、【\.】、【\|】、【\!】、【\M、【\K】、【\a】、【\o】、【\c】…………的一大堆。。。想用的时候又不记得,要回去翻脚本注释累死了【记性差的坏处哇!!!】。于是写了一个小软件帮忙:


以上是软件截图啦,,看看就知道是个很简单的NC东西吧 = =~~!
咳咳下面是操作的过程gif(580K)

嘿咻是很简单的玩意啦,也就写来自己用用,之所以发上来是怕有很新很新比我还新【看我的发帖量就知道多新了= =】的新手也记性不太好啦~ O(∩_∩)O~

【TAT 可是我发现用这个东西跟不用这个而去查脚本说明的方式,花的时间差不多耶。。哭555,捂脸】
=======================
适用脚本:

  1. #==============================================================================

  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息

  3. #==============================================================================


  4. #——说明


  5. #默认为一个字一个字的方式,如果需要一次全部显示,

  6. #请在游戏中使用脚本:$game_system.typing = true



  7. #默认对话字没有声音,如果需要声音,

  8. #请在游戏中使用脚本:$game_system.soundname_on_speak = "这里输入文件名"

  9. #我唯一一个见过“胡乱配音”的游戏是天使帝国2代,该游戏说话的时候每个字符随机发一个外星语音


  10. # 其他在对话中可以使用的功能:


  11. # \n[1]:显示1号角色的姓名


  12. # \name[李逍遥]:显示一个“李逍遥”方框,表示说话人姓名


  13. # \p[1]:对话框出现在1号事件的上方

  14. # \p[0]:主人公上方出现对话框,使用\p功能后可以自动调整对话框大小

  15. #——————————————————


  16. # \\:显示"\"这个符号


  17. # \c[1-8]:更改颜色,1蓝,2红,3绿,4天蓝,5紫,6黄,7灰,8白


  18. # \g:显示金钱窗口


  19. # \a[SE文件名]:对话的时候播放SE


  20. # \s[1-19]:更改弹字的速度


  21. # \. :停顿一刹那(1、2帧)

  22. # \| :停顿片刻(20帧)


  23. # \> :文字不用打字方式

  24. # \< :文字使用打字方式


  25. # \! :等待玩家按回车再继续

  26. # \~ :文字直接消失


  27. # \I :下一行从这个位置开始


  28. # \o[123]:文字透明度改为123,模拟将死之人(汗)


  29. # \h[12]:改用12号字


  30. # \b[50]:空50象素


  31. # \K[今天天气不错]:在出现“今天天气不错”这几个字的时候播放$game_system.soundname_on_speak设置的音效


  32. # \L[001]:在左边显示图片“Graphics/battlers/001_h.png”

  33. # \R[001]:在右边显示图片“Graphics/battlers/001_h.png”

  34. # \F[001]:在左边显示头像“Graphics/Pictures/001.png”


  35. # \Lk:清除左边的图像

  36. # \Rk:清除右边的图像

  37. # \M[60]:等待60帧文字直接消失


  38. #脚本冲突可能:

  39. #不用说了。因为改了分辨率所有原有窗口需要自己定义,基本上可以算是和所有脚本冲突。


  40. #============================

  41. class Game_System

  42. attr_accessor :typing

  43. attr_accessor :soundname_on_speak

  44. alias carol3_ini initialize

  45. def initialize

  46. carol3_ini

  47. @typing = true

  48. @soundname_on_speak = nil

  49. end

  50. end

  51. #=================================

  52. #==============================================================================

  53. # ■ Window_Message

  54. #------------------------------------------------------------------------------

  55. class Window_Message < Window_Selectable

  56. #--------------------------------------------------------------------------

  57. # ● 初始化状态

  58. #--------------------------------------------------------------------------

  59. def initialize

  60. super(80, 304, 480, 160)

  61. self.contents = Bitmap.new(width - 32, height - 32)

  62. self.visible = false

  63. self.z = 9998

  64. @fade_in = false

  65. @fade_out = false

  66. @contents_showing = false

  67. @cursor_width = 0

  68. @autoclosetime = -1

  69. self.active = false

  70. self.index = -1

  71. if $game_system.soundname_on_speak == nil then

  72. $game_system.soundname_on_speak = ""

  73. end

  74. @opacity_text_buf = Bitmap.new(32, 32)

  75. end

  76. #--------------------------------------------------------------------------

  77. # ● 释放

  78. #--------------------------------------------------------------------------

  79. def dispose

  80. terminate_message

  81. $game_temp.message_window_showing = false

  82. if @input_number_window != nil

  83. @input_number_window.dispose

  84. end

  85. super

  86. end

  87. #--------------------------------------------------------------------------

  88. # ● 处理信息结束

  89. #--------------------------------------------------------------------------

  90. def terminate_message

  91. self.active = false

  92. self.pause = false

  93. self.index = -1

  94. self.contents.clear

  95. # 清除显示中标志

  96. @contents_showing = false

  97. # 呼叫信息调用

  98. if $game_temp.message_proc != nil

  99. $game_temp.message_proc.call

  100. end

  101. # 清除文章、选择项、输入数值的相关变量

  102. $game_temp.message_text = nil

  103. $game_temp.message_proc = nil

  104. $game_temp.choice_start = 99

  105. $game_temp.choice_max = 0

  106. $game_temp.choice_cancel_type = 0

  107. $game_temp.choice_proc = nil

  108. $game_temp.num_input_start = 99

  109. $game_temp.num_input_variable_id = 0

  110. $game_temp.num_input_digits_max = 0

  111. # 开放金钱窗口

  112. if @gold_window != nil

  113. @gold_window.dispose

  114. @gold_window = nil

  115. end

  116. if @name_window_frame != nil

  117. @name_window_frame.dispose

  118. @name_window_frame = nil

  119. end

  120. if @name_window_text != nil

  121. @name_window_text.dispose

  122. @name_window_text = nil

  123. end

  124. if @right_picture != nil and @right_keep == true

  125. @right_picture.dispose

  126. end
  127. if @left_picture != nil and @left_keep == true

  128. @left_picture.dispose

  129. end

  130. end

  131. def refresh

  132. # 初期化

  133. self.contents.clear

  134. self.contents.font.color = normal_color

  135. self.contents.font.size = Font.default_size

  136. @x = @y = @max_x = @max_y = @indent = @lines = 0

  137. @left_keep = @right_keep = false

  138. @face_indent = 0

  139. @opacity = 255

  140. @cursor_width = 0

  141. @autoclosetime = -1

  142. @write_speed = 0

  143. @write_wait = 0

  144. @mid_stop = false

  145. @face_file = nil

  146. @popchar = -2

  147. if $game_temp.choice_start == 0

  148. @x = 8

  149. end

  150. if $game_temp.message_text != nil

  151. @now_text = $game_temp.message_text

  152. #——头像设置

  153. if (/\\[Ff]\[(.+?)\]/.match(@now_text))!=nil then

  154. @face_file = $1 + ".png"

  155. @x = @face_indent = 128

  156. if FileTest.exist?("Graphics/Pictures/" + $1 + ".png")

  157. self.contents.blt(16, 16, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))

  158. end

  159. @now_text.gsub!(/\\[Ff]\[(.*?)\]/) { "" }

  160. end

  161. #——左半身像设置

  162. if (/\\[Ll]\[(.+?)\]/.match(@now_text))!=nil then

  163. @face = $1 + "_h.png"

  164. if $加密 == true

  165. if @left_picture != nil

  166. @left_picture.dispose

  167. end

  168. @left_picture = Sprite.new

  169. @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")

  170. @left_picture.y = 480-@left_picture.bitmap.height

  171. @left_picture.x = 0

  172. @left_picture.mirror = true

  173. @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }

  174. else
  175. if FileTest.exist?("Graphics/battlers/#{@face}")

  176. if @left_picture != nil

  177. @left_picture.dispose

  178. end

  179. @left_picture = Sprite.new

  180. @left_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")

  181. @left_picture.y = 480-@left_picture.bitmap.height

  182. @left_picture.x = 0

  183. @left_picture.mirror = true

  184. @now_text.gsub!(/\\[Ll]\[(.*?)\]/) { "" }

  185. end

  186. end

  187. end

  188. #——右半身像设置

  189. if (/\\[Rr]\[(.+?)\]/.match(@now_text))!=nil then

  190. @face = $1 + "_h.png"

  191. if $加密 == true

  192. if @right_picture != nil

  193. @right_picture.dispose

  194. end

  195. @right_picture = Sprite.new

  196. @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")

  197. @right_picture.y = 480-@right_picture.bitmap.height

  198. @right_picture.x = 640-@right_picture.bitmap.width

  199. @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }

  200. else

  201. if FileTest.exist?("Graphics/battlers/#{@face}")

  202. if @right_picture != nil

  203. @right_picture.dispose

  204. end

  205. @right_picture = Sprite.new

  206. @right_picture.bitmap = Bitmap.new("Graphics/battlers/#{@face}")

  207. @right_picture.y = 480-@right_picture.bitmap.height

  208. @right_picture.x = 640-@right_picture.bitmap.width

  209. @now_text.gsub!(/\\[Rr]\[(.*?)\]/) { "" }

  210. end

  211. end

  212. end

  213. if (/\\[Rr]k/.match(@now_text)) != nil

  214. @right_keep = true

  215. @now_text.sub!(/\\[Rr]k/) { "" }

  216. end

  217. if (/\\[Ll]k/.match(@now_text)) != nil

  218. @left_keep = true

  219. @now_text.sub!(/\\[Ll]k/) { "" }

  220. end

  221. # 显示人物姓名

  222. name_window_set = false

  223. if (/\\[Nn]ame\[(.+?)\]/.match(@now_text)) != nil

  224. name_window_set = true

  225. name_text = $1

  226. @now_text.sub!(/\\[Nn]ame\[(.*?)\]/) { "" }

  227. end



  228. # 文字位置的判定

  229. if (/\\[Pp]\[([-1,0-9]+)\]/.match(@now_text))!=nil then

  230. @popchar = $1.to_i

  231. if @popchar == -1

  232. @x = @indent = 48

  233. @y = 4

  234. end

  235. @now_text.gsub!(/\\[Pp]\[([-1,0-9]+)\]/) { "" }

  236. end



  237. # 开始

  238. begin

  239. last_text = @now_text.clone

  240. @now_text.gsub!(/\\[Vv]\[([IiWwAaSs]?)([0-9]+)\]/) { convart_value($1, $2.to_i) }

  241. end until @now_text == last_text

  242. @now_text.gsub!(/\\[Nn]\[([0-9]+)\]/) do

  243. $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""

  244. end

  245. @now_text.gsub!(/\\\\/) { "\000" }

  246. @now_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }

  247. @now_text.gsub!(/\\[Gg]/) { "\002" }

  248. @now_text.gsub!(/\\[Ss]\[([0-9]+)\]/) { "\003[#{$1}]" }

  249. @now_text.gsub!(/\\[Aa]\[(.*?)\]/) { "\004[#{$1}]" }

  250. @now_text.gsub!(/\\[.]/) { "\005" }

  251. @now_text.gsub!(/\\[|]/) { "\006" }

  252. @now_text.gsub!(/\\[Mm]\[([0-9]+)\]/) { "\050[#{$1}]" }



  253. @now_text.gsub!(/\\[>]/) { "\016" }

  254. @now_text.gsub!(/\\[<]/) { "\017" }

  255. @now_text.gsub!(/\\[!]/) { "\020" }

  256. @now_text.gsub!(/\\[~]/) { "\021" }



  257. @now_text.gsub!(/\\[Ii]/) { "\023" }

  258. @now_text.gsub!(/\\[Oo]\[([0-9]+)\]/) { "\024[#{$1}]" }

  259. @now_text.gsub!(/\\[Hh]\[([0-9]+)\]/) { "\025[#{$1}]" }

  260. @now_text.gsub!(/\\[Bb]\[([0-9]+)\]/) { "\026[#{$1}]" }

  261. @now_text.gsub!(/\\[Kk]\[(.*?)\]/) { "\027[#{$1}]" }

  262. if @popchar >= 0

  263. @text_save = @now_text.clone

  264. @max_x = 0

  265. @max_y = 4

  266. for i in 0..3

  267. line = @now_text.split(/\n/)[3-i]

  268. @max_y -= 1 if line == nil and @max_y <= 4-i

  269. next if line == nil

  270. cx = contents.text_size(line).width

  271. @max_x = cx if cx > @max_x

  272. end

  273. self.width = @max_x + 48 + @face_indent

  274. self.height = (@max_y - 1) * 32 + 64

  275. else

  276. @max_x = self.width - 32 - @face_indent

  277. end

  278. reset_window

  279. if name_window_set

  280. off_x = 0

  281. off_y = -40

  282. space = 2

  283. x = self.x + off_x - space / 2

  284. y = self.y + off_y - space / 2

  285. w = self.contents.text_size(name_text).width + 26 + space

  286. h = 40 + space

  287. @name_window_frame = Window_Frame.new(x, y, w, h)

  288. @name_window_frame.z = self.z + 1

  289. x = self.x + off_x + 4

  290. y = self.y + off_y

  291. @name_window_text = Air_Text.new(x+4, y+6, name_text)

  292. @name_window_text.z = self.z + 2

  293. end

  294. end

  295. reset_window

  296. if $game_temp.choice_max > 0

  297. @item_max = $game_temp.choice_max

  298. self.active = true

  299. self.index = 0

  300. end

  301. if $game_temp.num_input_variable_id > 0

  302. digits_max = $game_temp.num_input_digits_max

  303. number = $game_variables[$game_temp.num_input_variable_id]

  304. @input_number_window = Window_InputNumber.new(digits_max)

  305. @input_number_window.number = number

  306. @input_number_window.x = self.x + 8

  307. @input_number_window.y = self.y + $game_temp.num_input_start * 32

  308. end

  309. end

  310. #--------------------------------------------------------------------------

  311. # ● 更新

  312. #--------------------------------------------------------------------------

  313. def update

  314. super

  315. if @autoclosetime == 0

  316. @autoclosetime = -1

  317. terminate_message

  318. end

  319. if @autoclosetime >= 1

  320. @autoclosetime -= 1

  321. end

  322. if @fade_in

  323. self.contents_opacity += 24

  324. if @input_number_window != nil

  325. @input_number_window.contents_opacity += 24

  326. end

  327. if self.contents_opacity == 255

  328. @fade_in = false

  329. end

  330. return

  331. end

  332. @now_text = nil if @now_text == ""


  333. if @now_text != nil and @mid_stop == false

  334. if @write_wait > 0

  335. @write_wait -= 1

  336. return

  337. end

  338. text_not_skip = $game_system.typing

  339. while true

  340. @max_x = @x if @max_x < @x

  341. @max_y = @y if @max_y < @y

  342. if (c = @now_text.slice!(/./m)) != nil

  343. if c == "\000"

  344. c = "\\"

  345. end

  346. if c == "\001"

  347. @now_text.sub!(/\[([0-9]+)\]/, "")

  348. color = $1.to_i

  349. if color >= 0 and color <= 7

  350. self.contents.font.color = text_color(color)

  351. end

  352. c = ""

  353. end

  354. if c == "\002"

  355. if @gold_window == nil and @popchar <= 0

  356. @gold_window = Window_Gold.new

  357. @gold_window.x = 560 - @gold_window.width

  358. if $game_temp.in_battle

  359. @gold_window.y = 192

  360. else

  361. @gold_window.y = self.y >= 128 ? 32 : 384

  362. end

  363. @gold_window.opacity = self.opacity

  364. @gold_window.back_opacity = self.back_opacity

  365. end

  366. c = ""

  367. end

  368. if c == "\003"

  369. @now_text.sub!(/\[([0-9]+)\]/, "")

  370. speed = $1.to_i

  371. if speed >= 0 and speed <= 19

  372. @write_speed = speed

  373. end

  374. c = ""

  375. end

  376. if c == "\004"

  377. @now_text.sub!(/\[(.*?)\]/, "")

  378. buftxt = $1.dup.to_s

  379. if buftxt.match(/\//) == nil and buftxt != "" then

  380. $game_system.soundname_on_speak = "Audio/SE/" + buftxt

  381. else

  382. $game_system.soundname_on_speak = buftxt.dup

  383. end

  384. c = ""

  385. elsif c == "\004"
  386. c = ""

  387. end

  388. if c == "\005"

  389. @write_wait += 5

  390. c = ""

  391. end

  392. if c == "\006"

  393. @write_wait += 20

  394. c = ""

  395. end

  396. if c == "\016"

  397. text_not_skip = false

  398. c = ""

  399. end

  400. if c == "\017"

  401. text_not_skip = true

  402. c = ""

  403. end

  404. if c == "\020"

  405. @mid_stop = true

  406. c = ""

  407. end

  408. if c == "\021"

  409. terminate_message

  410. return

  411. end

  412. if c == "\023"

  413. @indent = @x

  414. c = ""

  415. end

  416. if c == "\024"

  417. @now_text.sub!(/\[([0-9]+)\]/, "")

  418. @opacity = $1.to_i

  419. c = ""

  420. end

  421. if c == "\025"

  422. @now_text.sub!(/\[([0-9]+)\]/, "")

  423. self.contents.font.size = [[$1.to_i, 6].max, 32].min

  424. c = ""

  425. end

  426. if c == "\026"

  427. @now_text.sub!(/\[([0-9]+)\]/, "")

  428. @x += $1.to_i

  429. c = ""

  430. end

  431. if c == "\027"

  432. @now_text.sub!(/\[(.*?)\]/, "")

  433. @x += ruby_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), $1, @opacity)

  434. if $game_system.soundname_on_speak != ""

  435. Audio.se_play($game_system.soundname_on_speak)

  436. end

  437. c = ""

  438. end

  439. if c == "\030"

  440. @now_text.sub!(/\[(.*?)\]/, "")

  441. self.contents.blt(@x , @y * line_height + 8, RPG::Cache.icon($1), Rect.new(0, 0, 24, 24))

  442. if $game_system.soundname_on_speak != ""

  443. Audio.se_play($game_system.soundname_on_speak)

  444. end

  445. @x += 24

  446. c = ""

  447. end

  448. if c == "\050"


  449. @now_text.sub!(/\[([0-9]+)\]/, "")


  450. @autoclosetime = $1.to_i


  451. next


  452. end

  453. if c == "\n"

  454. if @lines >= $game_temp.choice_start

  455. @cursor_width = [@cursor_width, @max_x - @face_indent].max

  456. end

  457. @lines += 1

  458. @y += 1

  459. @x = 0 + @indent + @face_indent

  460. if @lines >= $game_temp.choice_start

  461. @x = 8 + @indent + @face_indent

  462. end

  463. c = ""

  464. end

  465. if c != ""

  466. # 文字描画

  467. @x += opacity_draw_text(self.contents, @x, @y * line_height + (line_height - self.contents.font.size), c, @opacity)

  468. if $game_system.soundname_on_speak != "" then

  469. Audio.se_play($game_system.soundname_on_speak)

  470. end

  471. end

  472. if Input.press?(Input::B)

  473. text_not_skip = false

  474. end

  475. else

  476. text_not_skip = true

  477. break

  478. end

  479. # 終了判定

  480. if text_not_skip

  481. break

  482. end

  483. end

  484. @write_wait += @write_speed

  485. return

  486. end

  487. if @input_number_window != nil

  488. @input_number_window.update

  489. # 決定

  490. if Input.trigger?(Input::C)

  491. $game_system.se_play($data_system.decision_se)

  492. $game_variables[$game_temp.num_input_variable_id] =

  493. @input_number_window.number

  494. $game_map.need_refresh = true

  495. @input_number_window.dispose

  496. @input_number_window = nil

  497. terminate_message

  498. end

  499. return

  500. end

  501. if @contents_showing

  502. if $game_temp.choice_max == 0

  503. self.pause = true

  504. end

  505. # 取消

  506. if Input.trigger?(Input::B)

  507. if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0

  508. $game_system.se_play($data_system.cancel_se)

  509. $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)

  510. terminate_message

  511. end

  512. end

  513. # 決定

  514. if Input.trigger?(Input::C)

  515. if $game_temp.choice_max > 0

  516. $game_system.se_play($data_system.decision_se)

  517. $game_temp.choice_proc.call(self.index)

  518. end

  519. if @mid_stop

  520. @mid_stop = false

  521. return

  522. else

  523. terminate_message

  524. end

  525. end

  526. return

  527. end

  528. if @fade_out == false and $game_temp.message_text != nil

  529. @contents_showing = true

  530. $game_temp.message_window_showing = true

  531. refresh

  532. Graphics.frame_reset

  533. self.visible = true

  534. self.contents_opacity = 0

  535. if @input_number_window != nil

  536. @input_number_window.contents_opacity = 0

  537. end

  538. @fade_in = true

  539. return

  540. end

  541. if self.visible

  542. @fade_out = true

  543. self.opacity -= 48

  544. if self.opacity == 0

  545. self.visible = false

  546. @fade_out = false

  547. $game_temp.message_window_showing = false

  548. end

  549. return

  550. end

  551. end

  552. #--------------------------------------------------------------------------

  553. # ● 获得字符

  554. #--------------------------------------------------------------------------

  555. def get_character(parameter)

  556. case parameter

  557. when 0
  558. return $game_player

  559. else
  560. events = $game_map.events

  561. return events == nil ? nil : events[parameter]

  562. end

  563. end

  564. #--------------------------------------------------------------------------

  565. # ● ウィンドウの位置と不透明度の設定

  566. #--------------------------------------------------------------------------

  567. def reset_window

  568. # 判定

  569. if @popchar >= 0

  570. events = $game_map.events

  571. if events != nil

  572. character = get_character(@popchar)

  573. x = [[character.screen_x - 0 - self.width / 2, 4].max, 636 - self.width].min

  574. y = [[character.screen_y - 48 - self.height, 4].max, 476 - self.height].min

  575. self.x = x

  576. self.y = y

  577. end

  578. elsif @popchar == -1

  579. self.x = -4

  580. self.y = -4

  581. self.width = 648

  582. self.height = 488

  583. else

  584. if $game_temp.in_battle

  585. self.y = 16

  586. else

  587. case $game_system.message_position

  588. when 0 # 上

  589. self.y = 16

  590. when 1 # 中

  591. self.y = 160

  592. when 2 # 下

  593. self.y = 304

  594. end

  595. self.x = 80

  596. if @face_file == nil

  597. self.width = 480

  598. else

  599. self.width = 600

  600. self.x -= 60

  601. end

  602. self.height = 160

  603. end

  604. end

  605. self.contents = Bitmap.new(self.width - 32, self.height - 32)

  606. if @face_file != nil

  607. self.contents.blt(0, 0, RPG::Cache.picture(@face_file), Rect.new(0, 0, 120, 120))

  608. end

  609. if @popchar == -1

  610. self.opacity = 255

  611. self.back_opacity = 0

  612. elsif $game_system.message_frame == 0

  613. self.opacity = 255

  614. self.back_opacity = 200

  615. else

  616. self.opacity = 0

  617. self.back_opacity = 200

  618. end

  619. end

  620. #--------------------------------------------------------------------------

  621. # ● line_height

  622. #--------------------------------------------------------------------------

  623. # 返回値:行高

  624. #--------------------------------------------------------------------------

  625. def line_height

  626. return 32

  627. if self.contents.font.size >= 20 and self.contents.font.size <= 24

  628. return 32

  629. else

  630. return self.contents.font.size * 15 / 10

  631. end

  632. end

  633. #--------------------------------------------------------------------------

  634. # ● 透過文字描画

  635. #--------------------------------------------------------------------------

  636. # target :描画対象。Bitmapクラスを指定。

  637. # x :x座標

  638. # y :y座標

  639. # str  :描画文字列

  640. # opacity:透過率(0~255)

  641. # 返回値 :文字幅(@x増加値)。

  642. #--------------------------------------------------------------------------

  643. def opacity_draw_text(target, x, y, str,opacity)

  644. height = target.font.size

  645. width = target.text_size(str).width

  646. opacity = [[opacity, 0].max, 255].min

  647. if opacity == 255

  648. target.draw_text(x, y, width, height, str)

  649. return width

  650. else

  651. if @opacity_text_buf.width < width or @opacity_text_buf.height < height

  652. @opacity_text_buf.dispose

  653. @opacity_text_buf = Bitmap.new(width, height)

  654. else

  655. @opacity_text_buf.clear

  656. end

  657. @opacity_text_buf.font.size = target.font.size

  658. @opacity_text_buf.draw_text(0, 0, width, height, str)

  659. target.blt(x, y, @opacity_text_buf, Rect.new(0, 0, width, height), opacity)

  660. return width

  661. end

  662. end

  663. def ruby_draw_text(target, x, y, str,opacity)

  664. sizeback = target.font.size

  665. target.font.size * 3 / 2 > 32 ? rubysize = 32 - target.font.size : rubysize = target.font.size / 2

  666. rubysize = [rubysize, 6].max



  667. opacity = [[opacity, 0].max, 255].min

  668. split_s = str.split(/,/)



  669. split_s[0] == nil ? split_s[0] = "" : nil

  670. split_s[1] == nil ? split_s[1] = "" : nil



  671. height = sizeback + rubysize

  672. width = target.text_size(split_s[0]).width



  673. target.font.size = rubysize

  674. ruby_width = target.text_size(split_s[1]).width

  675. target.font.size = sizeback



  676. buf_width = [target.text_size(split_s[0]).width, ruby_width].max



  677. width - ruby_width != 0 ? sub_x = (width - ruby_width) / 2 : sub_x = 0



  678. if opacity == 255

  679. target.font.size = rubysize

  680. target.draw_text(x + sub_x, y - target.font.size, target.text_size(split_s[1]).width, target.font.size, split_s[1])

  681. target.font.size = sizeback

  682. target.draw_text(x, y, width, target.font.size, split_s[0])

  683. return width

  684. else

  685. if @opacity_text_buf.width < buf_width or @opacity_text_buf.height < height

  686. @opacity_text_buf.dispose

  687. @opacity_text_buf = Bitmap.new(buf_width, height)

  688. else

  689. @opacity_text_buf.clear

  690. end

  691. @opacity_text_buf.font.size = rubysize

  692. @opacity_text_buf.draw_text(0 , 0, buf_width, rubysize, split_s[1], 1)

  693. @opacity_text_buf.font.size = sizeback

  694. @opacity_text_buf.draw_text(0 , rubysize, buf_width, sizeback, split_s[0], 1)

  695. if sub_x >= 0

  696. target.blt(x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)

  697. else

  698. target.blt(x + sub_x, y - rubysize, @opacity_text_buf, Rect.new(0, 0, buf_width, height), opacity)

  699. end

  700. return width

  701. end

  702. end

  703. #--------------------------------------------------------------------------

  704. # ● \V 变换

  705. #--------------------------------------------------------------------------

  706. def convart_value(option, index)

  707. option == nil ? option = "" : nil

  708. option.downcase!

  709. case option

  710. when "i"

  711. unless $data_items[index].name == nil

  712. r = sprintf("\030[%s]%s", $data_items[index].icon_name, $data_items[index].name)

  713. end

  714. when "w"

  715. unless $data_weapons[index].name == nil

  716. r = sprintf("\030[%s]%s", $data_weapons[index].icon_name, $data_weapons[index].name)

  717. end

  718. when "a"

  719. unless $data_armors[index].name == nil

  720. r = sprintf("\030[%s]%s", $data_armors[index].icon_name, $data_armors[index].name)

  721. end

  722. when "s"

  723. unless $data_skills[index].name == nil

  724. r = sprintf("\030[%s]%s", $data_skills[index].icon_name, $data_skills[index].name)

  725. end

  726. else

  727. r = $game_variables[index]

  728. end

  729. r == nil ? r = "" : nil

  730. return r

  731. end

  732. #--------------------------------------------------------------------------

  733. # ● 解放

  734. #--------------------------------------------------------------------------

  735. def dispose

  736. terminate_message

  737. if @gaiji_cache != nil

  738. unless @gaiji_cache.disposed?

  739. @gaiji_cache.dispose

  740. end

  741. end

  742. unless @opacity_text_buf.disposed?

  743. @opacity_text_buf.dispose

  744. end

  745. $game_temp.message_window_showing = false

  746. if @input_number_window != nil

  747. @input_number_window.dispose

  748. end

  749. super

  750. end

  751. #--------------------------------------------------------------------------

  752. # ● 矩形更新

  753. #--------------------------------------------------------------------------

  754. def update_cursor_rect

  755. if @index >= 0

  756. n = $game_temp.choice_start + @index

  757. self.cursor_rect.set(4 + @indent + @face_indent, n * 32 + 4, @cursor_width, 32)

  758. else

  759. self.cursor_rect.empty

  760. end

  761. end

  762. end

  763. #==============================================================================

  764. # ■ Window_Frame (枠だけで中身の無いウィンドウ)

  765. #==============================================================================

  766. class Window_Frame < Window_Base

  767. #--------------------------------------------------------------------------

  768. # ● オブジェクト初期化

  769. #--------------------------------------------------------------------------

  770. def initialize(x, y, width, height)

  771. super(x, y, width, height)

  772. self.contents = nil

  773. self.back_opacity = 100

  774. end

  775. #--------------------------------------------------------------------------

  776. # ● 解放

  777. #--------------------------------------------------------------------------

  778. def dispose

  779. super

  780. end

  781. end

  782. #==============================================================================

  783. # ■ Air_Text (何も無いところに文字描写 = 枠の無い瞬間表示メッセージウィンドウ)

  784. #==============================================================================

  785. class Air_Text < Window_Base

  786. #--------------------------------------------------------------------------

  787. # ● オブジェクト初期化

  788. #--------------------------------------------------------------------------

  789. def initialize(x, y, designate_text)

  790. super(x-16, y-16, 32 + designate_text.size * 12, 56)

  791. self.opacity = 0

  792. self.back_opacity = 0

  793. self.contents = Bitmap.new(self.width - 32, self.height - 32)

  794. w = self.contents.width

  795. h = self.contents.height

  796. self.contents.draw_text(0, 0, w, h, designate_text)

  797. end

  798. #--------------------------------------------------------------------------

  799. # ● 解放

  800. #--------------------------------------------------------------------------

  801. def dispose

  802. self.contents.clear

  803. super

  804. end

  805. end




  806. #==============================================================================

  807. # 本脚本来自www.66RPG.com,使用和转载请保留此信息

  808. #==============================================================================
复制代码
以上和哪个经典脚本有一点点不同啦。。我改了一点点而已就是【窗口默认透明度】
恩恩
下载地址【个人用滴东西,也没指望有几个人下,权当给论坛增加点东西- -】
http://115.com/file/e7cahjds#
【怕毒勿下。。。。小生水平还没有高到写病毒的境界。。。捂脸。。跑走】

Lv1.梦旅人

梦石
0
星屑
239
在线时间
2399 小时
注册时间
2008-4-11
帖子
12326

贵宾第6届短篇游戏比赛季军

2
发表于 2012-7-21 15:16:41 | 只看该作者
你是有多执着。。。。我大多也就是把指令抄在纸上之类的
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
229
在线时间
596 小时
注册时间
2010-6-21
帖子
1218
3
发表于 2012-7-21 18:29:24 | 只看该作者
还不错,前排围观,但是这发到这里真的没有问题吗?
如果我是一个美工就好啦!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
150 小时
注册时间
2012-6-14
帖子
145
4
发表于 2012-7-21 22:57:26 | 只看该作者
好东西,多谢楼主。
回复 支持 反对

使用道具 举报

Lv3.寻梦者 (版主)

  /) /)<

梦石
0
星屑
4212
在线时间
4890 小时
注册时间
2009-2-16
帖子
8434

开拓者短篇七成年组季军

5
发表于 2012-7-21 23:08:51 | 只看该作者
其实指令 功能什么的 一般的RPG不常用吧……
回复 支持 反对

使用道具 举报

Lv2.观梦者


  • 更新完成啦

梦石
0
星屑
779
在线时间
6267 小时
注册时间
2006-6-7
帖子
8462
6
发表于 2012-7-21 23:12:53 | 只看该作者
毫无易语言痕迹。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
13 小时
注册时间
2011-3-17
帖子
8
7
 楼主| 发表于 2012-7-21 23:17:50 手机端发表。 | 只看该作者
传说VS天涯 发表于 2012-7-21 23:12
毫无易语言痕迹。

本来用VB.NET的…可是宿舍里的本本没有装visual studio……(︶︿︶)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
13 小时
注册时间
2011-3-17
帖子
8
8
 楼主| 发表于 2012-7-21 23:19:28 手机端发表。 | 只看该作者
懒De说 发表于 2012-7-21 18:29
还不错,前排围观,但是这发到这里真的没有问题吗?

实在不好意思发到原创区…丢人呐
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-6-27 15:26

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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