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

Project1

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

[RM脚本] 改变游戏字体颜色的脚本

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

Lv1.梦旅人 (禁止发言)

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

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
0 小时
注册时间
2006-10-19
帖子
25
2
 楼主| 发表于 2006-11-7 13:32:46 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽

Lv1.梦旅人

NewS-

梦石
0
星屑
172
在线时间
21 小时
注册时间
2006-7-14
帖子
629
3
发表于 2006-11-8 02:34:30 | 只看该作者
说明不够{/gg}

感觉这个脚本需要配合工程一起发布。

纯意见。
RockK & Abu.     2020.
热血物语RM+
回复 支持 反对

使用道具 举报

Lv1.梦旅人

彩色的银子

梦石
0
星屑
50
在线时间
190 小时
注册时间
2006-6-13
帖子
1361

贵宾

4
发表于 2006-11-8 02:36:41 | 只看该作者
- -`||粘进去就好了..然后
$scene = Text_color.new


用了一下..感觉不太好啊...
改完后如果不满意想再改.再进去他又会变成255,255,255..而且按的又慢- -`||
-.-
回复 支持 反对

使用道具 举报

Lv1.梦旅人

彩色的银子

梦石
0
星屑
50
在线时间
190 小时
注册时间
2006-6-13
帖子
1361

贵宾

5
发表于 2006-11-8 03:25:33 | 只看该作者
无聊改了一下``
{/cy}这样就可以保留上次修改过的颜色``~~
颜色也会跟着储存被保存起来``~~
  1. #===================================
  2. # Script by Corbaque                                
  3. #---------------------------------------------------------------
  4. # 04 / 07 / 2006                                                   
  5. #---------------------------------------------------------------
  6. # This script is used to modify the color of the texts
  7. # In the game
  8. #===================================
  9. class Text_color
  10. #-------------------------------------------------------------
  11. # Methode d'appel - Définition des variable
  12. #-------------------------------------------------------------
  13. def initialize
  14.   if defined?(@color_proto) then @color_proto = $normal_c else
  15.     @color_proto = Color.new(255, 255, 255, 255)
  16.     @r = $normal_c.red#255
  17.     @v = $normal_c.green#255
  18.     @b = $normal_c.blue#255
  19.     @o = $normal_c.alpha#255
  20.   end
  21.   @i = 0
  22.   @color_pulse = 0
  23. end
  24. def main
  25.   #-----------------------------------------------------------
  26.   # Methode Maître - Définition des fenêtre,
  27.   # Boucle de mise à jour et suppression des
  28.   # Fenêtre (lorsque qu'une autre classe est
  29.   # Appelée
  30.   #-----------------------------------------------------------
  31.   @demo = Window_Base.new(0, 0, 640, 480)
  32.   @demo.contents = Bitmap.new(608, 442)
  33.   @demo.contents.font.name = $fontface
  34.   @demo.contents.font.size = 50
  35.   @demo.contents.font.bold = true
  36.   @selec = Window_Command.new(400,
  37.   ["红", "绿", "蓝", "透明度", "默认", "样式  =>"])
  38.   @selec.x = 120
  39.   @selec.y = 200
  40.   @jauge = Window_Base.new(0, 0, 280, @selec.height)
  41.   @jauge.contents = Bitmap.new(@selec.width, @selec.height)
  42.   @jauge.contents.font.name = $fontface
  43.   @jauge.contents.font.size = 22
  44.   @jauge.x = 220
  45.   @jauge.y = 200
  46.   @jauge.opacity = @jauge.back_opacity = 0
  47.   Graphics.transition
  48.   while $scene == self
  49.     Graphics.update
  50.     Input.update
  51.     update
  52.   end
  53.   Graphics.freeze
  54.   @demo.dispose
  55.   @jauge.dispose
  56.   @selec.dispose
  57. end
  58. #-------------------------------------------------------------
  59. # Methode de mise à jour
  60. #-------------------------------------------------------------
  61. def update
  62.   # Mise à jour des fenêtres
  63.   @color_proto = Color.new(@r, @v, @b, @o)
  64.   @demo.contents.clear
  65.   @demo.contents.font.color = @color_proto
  66.   @demo.contents.draw_text(250, 4, 200, 96, "样式")
  67.   @demo.update
  68.   @jauge.contents.clear
  69.   # Ce code monstre est en faite tout simple, chacune de ces lignes
  70.   # Servent à tracer un fill (ligne) et sont classés de manière à faire
  71.   # Des jauges, ce code est en quatre parties.
  72.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  73.   # Jauge de rouge
  74.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  75.   @jauge.contents.fill_rect(4, 8, 240, 1, Color.new(0, 0, 0, 255))
  76.   @jauge.contents.fill_rect(4, 9, 240, 1, Color.new(100, 100, 100, 255))
  77.   @jauge.contents.fill_rect(4, 10, 240, 1, Color.new(200, 200, 200, 255))
  78.   @jauge.contents.fill_rect(4, 11, 240, 1, Color.new(255, 255, 255, 255))
  79.   @jauge.contents.fill_rect(4, 12, 240, 4, Color.new(0, 0, 0, 255))
  80.   @jauge.contents.fill_rect(4, 16, 240, 4, Color.new(0, 0, 0, 255))
  81.   @jauge.contents.fill_rect(4, 17, 240, 4, Color.new(0, 0, 0, 255))
  82.   @jauge.contents.fill_rect(4, 21, 240, 1, Color.new(255, 255, 255, 255))
  83.   @jauge.contents.fill_rect(4, 22, 240, 1, Color.new(200, 200, 200, 255))
  84.   @jauge.contents.fill_rect(4, 23, 240, 1, Color.new(100, 100, 100, 255))
  85.   @jauge.contents.fill_rect(4, 24, 240, 1, Color.new(0, 0, 0, 255))
  86.   @jauge.contents.fill_rect(4, 12, @r * 240 / 255, 2, Color.new(@r, 0, 0, 105))
  87.   @jauge.contents.fill_rect(4, 14, @r * 240 / 255, 2, Color.new(@r, 0, 0, 255))
  88.   @jauge.contents.fill_rect(4, 16, @r * 240 / 255, 2, Color.new(@r, 0, 0, 255))
  89.   @jauge.contents.fill_rect(4, 18, @r * 240 / 255, 2, Color.new(@r, 0, 0, 105))
  90.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  91.   # Jauge de vert
  92.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  93.   @jauge.contents.fill_rect(4, 32 + 8, 240, 1, Color.new(0, 0, 0, 255))
  94.   @jauge.contents.fill_rect(4, 32 + 9, 240, 1, Color.new(100, 100, 100, 255))
  95.   @jauge.contents.fill_rect(4, 32 + 10, 240, 1, Color.new(200, 200, 200, 255))
  96.   @jauge.contents.fill_rect(4, 32 + 11, 240, 1, Color.new(255, 255, 255, 255))
  97.   @jauge.contents.fill_rect(4, 32 + 12, 240, 4, Color.new(0, 0, 0, 255))
  98.   @jauge.contents.fill_rect(4, 32 + 16, 240, 4, Color.new(0, 0, 0, 255))
  99.   @jauge.contents.fill_rect(4, 32 + 17, 240, 4, Color.new(0, 0, 0, 255))
  100.   @jauge.contents.fill_rect(4, 32 + 21, 240, 1, Color.new(255, 255, 255, 255))
  101.   @jauge.contents.fill_rect(4, 32 + 22, 240, 1, Color.new(200, 200, 200, 255))
  102.   @jauge.contents.fill_rect(4, 32 + 23, 240, 1, Color.new(100, 100, 100, 255))
  103.   @jauge.contents.fill_rect(4, 32 + 24, 240, 1, Color.new(0, 0, 0, 255))
  104.   @jauge.contents.fill_rect(4, 32 + 12, @v * 240 / 255, 2, Color.new(0, @v, 0, 105))
  105.   @jauge.contents.fill_rect(4, 32 + 14, @v * 240 / 255, 2, Color.new(0, @v, 0, 255))
  106.   @jauge.contents.fill_rect(4, 32 + 16, @v * 240 / 255, 2, Color.new(0, @v, 0, 255))
  107.   @jauge.contents.fill_rect(4, 32 + 18, @v * 240 / 255, 2, Color.new(0, @v, 0, 105))
  108.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  109.   # Jauge de bleu
  110.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  111.   @jauge.contents.fill_rect(4, 64 + 8, 240, 1, Color.new(0, 0, 0, 255))
  112.   @jauge.contents.fill_rect(4, 64 + 9, 240, 1, Color.new(100, 100, 100, 255))
  113.   @jauge.contents.fill_rect(4, 64 + 10, 240, 1, Color.new(200, 200, 200, 255))
  114.   @jauge.contents.fill_rect(4, 64 + 11, 240, 1, Color.new(255, 255, 255, 255))
  115.   @jauge.contents.fill_rect(4, 64 + 12, 240, 4, Color.new(0, 0, 0, 255))
  116.   @jauge.contents.fill_rect(4, 64 + 16, 240, 4, Color.new(0, 0, 0, 255))
  117.   @jauge.contents.fill_rect(4, 64 + 17, 240, 4, Color.new(0, 0, 0, 255))
  118.   @jauge.contents.fill_rect(4, 64 + 21, 240, 1, Color.new(255, 255, 255, 255))
  119.   @jauge.contents.fill_rect(4, 64 + 22, 240, 1, Color.new(200, 200, 200, 255))
  120.   @jauge.contents.fill_rect(4, 64 + 23, 240, 1, Color.new(100, 100, 100, 255))
  121.   @jauge.contents.fill_rect(4, 64 + 24, 240, 1, Color.new(0, 0, 0, 255))
  122.   @jauge.contents.fill_rect(4, 64 + 12, @b * 240 / 255, 2, Color.new(0, 0, @b, 105))
  123.   @jauge.contents.fill_rect(4, 64 + 14, @b * 240 / 255, 2, Color.new(0, 0, @b, 255))
  124.   @jauge.contents.fill_rect(4, 64 + 16, @b * 240 / 255, 2, Color.new(0, 0, @b, 255))
  125.   @jauge.contents.fill_rect(4, 64 + 18, @b * 240 / 255, 2, Color.new(0, 0, @b, 105))
  126.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  127.   # Jauge d'opacitée
  128.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  129.   @jauge.contents.fill_rect(4, 96 + 8, 240, 1, Color.new(0, 0, 0, 255))
  130.   @jauge.contents.fill_rect(4, 96 + 9, 240, 1, Color.new(100, 100, 100, 255))
  131.   @jauge.contents.fill_rect(4, 96 + 10, 240, 1, Color.new(200, 200, 200, 255))
  132.   @jauge.contents.fill_rect(4, 96 + 11, 240, 1, Color.new(255, 255, 255, 255))
  133.   @jauge.contents.fill_rect(4, 96 + 12, 240, 4, Color.new(0, 0, 0, 255))
  134.   @jauge.contents.fill_rect(4, 96 + 16, 240, 4, Color.new(0, 0, 0, 255))
  135.   @jauge.contents.fill_rect(4, 96 + 17, 240, 4, Color.new(0, 0, 0, 255))
  136.   @jauge.contents.fill_rect(4, 96 + 21, 240, 1, Color.new(255, 255, 255, 255))
  137.   @jauge.contents.fill_rect(4, 96 + 22, 240, 1, Color.new(200, 200, 200, 255))
  138.   @jauge.contents.fill_rect(4, 96 + 23, 240, 1, Color.new(100, 100, 100, 255))
  139.   @jauge.contents.fill_rect(4, 96 + 24, 240, 1, Color.new(0, 0, 0, 255))
  140.   @jauge.contents.fill_rect(4, 96 + 12, @o * 240 / 255, 2, Color.new(150, 150, 150, @o))
  141.   @jauge.contents.fill_rect(4, 96 + 14, @o * 240 / 255, 2, Color.new(255, 255, 255, @o))
  142.   @jauge.contents.fill_rect(4, 96 + 16, @o * 240 / 255, 2, Color.new(255, 255, 255, @o))
  143.   @jauge.contents.fill_rect(4, 96 + 18, @o * 240 / 255, 2, Color.new(150, 150, 150, @o))
  144.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  145.   # Couleur en question
  146.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  147.   case @i
  148.   when 0
  149.     @jauge.contents.draw_text(4, 128, 100, 96, "Base")
  150.   when 1
  151.     @jauge.contents.draw_text(4, 128, 200, 96, "Systême")
  152.   when 2
  153.     @jauge.contents.draw_text(4, 128, 200, 96, "Desactivé")
  154.   when 3
  155.     @jauge.contents.draw_text(4, 128, 200, 96, "Etat Critique")
  156.   when 4
  157.     @jauge.contents.draw_text(4, 128, 200, 96, "Mort")
  158.   end
  159.   @jauge.update
  160.   @selec.update
  161.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  162.   # Celon l'index de la fenêtre,
  163.   # Auguementation, diminution et défauts des
  164.   # Différents variables, ou conclusion de la
  165.   # Classe (Appel du menu par défaut,
  166.   # Modifiable
  167.   #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  168.   case @selec.index
  169.   when 0
  170.     if Input.repeat?(Input::LEFT)
  171.       unless @r < 5
  172.         $game_system.se_play($data_system.cursor_se)
  173.         @r -=  5
  174.         return
  175.       end
  176.       $game_system.se_play($data_system.buzzer_se)
  177.     elsif Input.repeat?(Input::RIGHT)
  178.       unless @r > 250
  179.         $game_system.se_play($data_system.cursor_se)
  180.         @r += 5
  181.         return
  182.       end
  183.       $game_system.se_play($data_system.buzzer_se)
  184.     end
  185.   when 1
  186.     if Input.repeat?(Input::LEFT)
  187.       unless @v < 5
  188.         $game_system.se_play($data_system.cursor_se)
  189.         @v -= 5
  190.         return
  191.       end
  192.       $game_system.se_play($data_system.buzzer_se)
  193.     elsif Input.repeat?(Input::RIGHT)
  194.       unless @v > 250
  195.         $game_system.se_play($data_system.cursor_se)
  196.         @v += 5
  197.         return
  198.       end
  199.       $game_system.se_play($data_system.buzzer_se)
  200.     end
  201.   when 2
  202.     if Input.repeat?(Input::LEFT)
  203.       unless @b < 5
  204.         $game_system.se_play($data_system.cursor_se)
  205.         @b -= 5
  206.         return
  207.       end
  208.       $game_system.se_play($data_system.buzzer_se)
  209.     elsif Input.repeat?(Input::RIGHT)
  210.       unless @b > 250
  211.         $game_system.se_play($data_system.cursor_se)
  212.         @b += 5
  213.         return
  214.       end
  215.       $game_system.se_play($data_system.buzzer_se)
  216.     end
  217.   when 3
  218.     if Input.repeat?(Input::LEFT)
  219.       unless @o < 5
  220.         $game_system.se_play($data_system.cursor_se)
  221.         @o -= 5
  222.         return
  223.       end
  224.       $game_system.se_play($data_system.buzzer_se)
  225.     elsif Input.repeat?(Input::RIGHT)
  226.       unless @o > 250
  227.         $game_system.se_play($data_system.cursor_se)
  228.         @o += 5
  229.         return
  230.       end
  231.       $game_system.se_play($data_system.buzzer_se)
  232.     end
  233.   when 4
  234.     if Input.trigger?(Input::C)
  235.     $game_system.se_play($data_system.cursor_se)
  236.       @r = 255
  237.       @v = 255
  238.       @b = 255
  239.       @o = 255
  240.     end
  241.   when 5
  242.     if Input.repeat?(Input::LEFT)
  243.       $game_system.se_play($data_system.cursor_se)
  244.       unless @i == 0
  245.         @i -= 1
  246.         return
  247.       end
  248.       @i = 4
  249.     elsif Input.repeat?(Input::RIGHT)
  250.       $game_system.se_play($data_system.cursor_se)
  251.       @i += 1
  252.       @i %= 5
  253.     end
  254.   end
  255.   if Input.trigger?(Input::C)
  256.     unless @selec.index == 4
  257.       case @i
  258.       when 0
  259.         $normal_c = @color_proto
  260.       when 1
  261.         $system_c = @color_proto
  262.       when 2
  263.         $disable_c = @color_proto
  264.       when 3
  265.         $crisis_c = @color_proto
  266.       when 4
  267.         $die_c = @color_proto
  268.       end
  269.       #Replace this line by calls scene which
  270.       # you wish, example :
  271.       # $scene = Scene_Map.new
  272.       $scene = Scene_Menu.new
  273.     end
  274.   end
  275.   if @selec.index == -1
  276.     @selec.index = 0
  277.   end
  278.   @selec.refresh
  279. end
  280. end
  281. #===================================
  282. # Add-on at Window_Base
  283. #===================================
  284. class Window_Base < Window
  285. def normal_color
  286.   return $normal_c
  287. end
  288. def disabled_color
  289.   return $disable_c
  290. end
  291. def system_color
  292.   return $system_c
  293. end
  294. def crisis_color
  295.   return $crisis_c
  296. end
  297. def knockout_color
  298.   return $die_c
  299. end
  300. end
  301. class Scene_Save < Scene_File
  302.   alias wr write_save_data
  303.   def write_save_data(file)
  304.     wr(file)
  305.     Marshal.dump($normal_c, file)
  306.   end
  307. end
  308. class Scene_Load < Scene_File
  309.   alias wr read_save_data
  310.   def read_save_data(file)
  311.     wr(file)
  312.     $normal_c        = Marshal.load(file)
  313.   end
  314. end
  315.   
  316.   
复制代码
-.-
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-27 01:37

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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