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

Project1

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

[已经过期] 【求助】请问战斗界面血条数字和字母的显示在哪里改?

[复制链接]

Lv2.观梦者

梦石
0
星屑
686
在线时间
218 小时
注册时间
2016-5-10
帖子
99
跳转到指定楼层
1
发表于 2016-8-9 20:36:37 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式

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

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

x

使用了:战斗全动态HP,MP,TP(Battle_H.M.T)
脚本打上后是成功了,可是字母和数字位置和字体需要调整。
请问在哪里可以调整字母和数字显示的位置。
求大神帮助。
另:求血条 蓝条的颜色修改方法,我想把血条弄成绿色或者红色的,不想要橙色的。
下面上代码:
  1. # -----------------------------------------------------------------------------
  2. # ◆战斗全动态HP,MP,TP(Battle_H.M.T) By.Clov
  3. # -----------------------------------------------------------------------------
  4. # Ver:1.0.0 Date:2012.04.08
  5. # -1.0.0:基本版
  6. # Ver:1.0.1 Date:2012.04.09
  7. # -1.0.1:修正逃跑返回不显示问题
  8. # -----------------------------------------------------------------------------
  9. #==============================================================================
  10. # ■ Window_BattleStatus
  11. #------------------------------------------------------------------------------
  12. #  战斗画面中,显示[队伍成员状态的窗口。
  13. #==============================================================================

  14. class Window_BattleStatus < Window_Selectable
  15.   #--------------------------------------------------------------------------
  16.   # ● 初始化
  17.   #--------------------------------------------------------------------------
  18.   def initialize
  19.     super(0, 0, window_width, window_height)
  20.     new_hmt unless self.is_a?(Window_BattleActor)
  21.     refresh
  22.     self.openness = 0
  23.   end
  24.   #--------------------------------------------------------------------------
  25.   # ◆ 生成新的动态插槽
  26.   #--------------------------------------------------------------------------
  27.   def new_hmt
  28.     hp1 = Color.new(225, 128, 64, 255)
  29.     hp2 = Color.new(225, 192, 64, 255)
  30.     mp1 = Color.new(64, 128, 192, 255)
  31.     mp2 = Color.new(64, 192, 240, 255)
  32.     tp1 = Color.new(36, 5, 79, 255)
  33.     tp2 = Color.new(231, 90, 145, 255)
  34.     @actor_hp = [];@actor_mp = [];@actor_tp = []
  35.     if $data_system.opt_display_tp
  36.       x = 305;y = 320;w = 66;w2 = 6;h = 10;wx = 76;hx = 24;i = 0
  37.     else
  38.       x = 305;y = 320;w = 77;w2 = 54;h = 10;wx = 90;hx = 24;i = 0
  39.     end
  40.     $game_party.battle_members.each {|actor|
  41.       if $data_system.opt_display_tp
  42.         @actor_tp[i] = DynamicSlot.new(x+wx*2+w2,y+i*hx,150,w,h,tp1,tp2,:UD,false)
  43.         @actor_tp[i].slot_dynamic_speed(0.2)
  44.         @actor_tp[i].value_max(100)
  45.         @actor_tp[i].auto_normal_draw(0)
  46.         @actor_tp[i].value_set(2,24)
  47.         @actor_tp[i].value_xy(x+wx*2+w2-w,y+i*hx-10)
  48.       end
  49.       @actor_mp[i] = DynamicSlot.new(x+wx+w2,y+i*hx,150,w,h,mp1,mp2,:LR,false)
  50.       @actor_mp[i].value_max(actor.mmp)
  51.       @actor_mp[i].auto_normal_draw(actor.mp)
  52.       @actor_mp[i].value_set(2,24)
  53.       @actor_mp[i].value_xy(x+wx+w2-w,y+i*hx-10)
  54.       free = i == item_max - 1 ? true : false
  55.       @actor_hp[i] = DynamicSlot.new(x,y+i*hx,150,w+w2,h,hp1,hp2,:LR,free)
  56.       @actor_hp[i].value_max(actor.mhp)
  57.       @actor_hp[i].auto_normal_draw(actor.hp)
  58.       @actor_hp[i].value_set(2,24)
  59.       @actor_hp[i].value_xy(x-(w+w2),y+i*hx-10)
  60.     i+=1}
  61.     for i in 0...item_max
  62.       @actor_hp[item_max - 1].free_text(x,y+i*hx-12,Vocab::hp_a,0,28,nil,nil,system_color)
  63.       @actor_hp[item_max - 1].free_text(x+wx+w2,y+i*hx-10,Vocab::mp_a,0,28,nil,nil,system_color)
  64.       @actor_hp[item_max - 1].free_text(x+wx*2+w2,y+i*hx-10,Vocab::tp_a,0,28,nil,nil,system_color)
  65.     end
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ◆ 取得目前动态插槽
  69.   #--------------------------------------------------------------------------
  70.   def now_hmt
  71.     @actor_hp + @actor_mp  + @actor_tp
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ◆ 刷新、释放动态插槽
  75.   #--------------------------------------------------------------------------
  76.   def update
  77.     super
  78.     unless self.is_a?(Window_BattleActor)
  79.       now_hmt.each{|hmt|hmt.update}
  80.     end
  81.   end
  82.   def dispose
  83.     super
  84.     unless self.is_a?(Window_BattleActor)
  85.       now_hmt.each{|hmt|hmt.dispose}
  86.    end
  87.   end
  88.   #--------------------------------------------------------------------------
  89.   # ● 描画项目
  90.   #--------------------------------------------------------------------------
  91.   def draw_item(index)
  92.     actor = $game_party.battle_members[index]
  93.     draw_basic_area(basic_area_rect(index), actor)
  94.     unless self.is_a?(Window_BattleActor)
  95.       @actor_hp[index].auto_gradually_draw(actor.hp)
  96.       @actor_mp[index].auto_gradually_draw(actor.mp)
  97.       @actor_tp[index].auto_gradually_draw(actor.tp.to_i) if $data_system.opt_display_tp
  98.     end
  99.   end
  100. end

  101. #==============================================================================
  102. # ■ Scene_Battle
  103. #------------------------------------------------------------------------------
  104. #  战斗画面
  105. #==============================================================================

  106. class Scene_Battle < Scene_Base
  107.   #--------------------------------------------------------------------------
  108.   # ● 移动信息显示的显示端口
  109.   #--------------------------------------------------------------------------
  110.   alias move_info_viewportY move_info_viewport
  111.   def move_info_viewport(ox)
  112.     move_info_viewportY(ox)
  113.     current_ox = @info_viewport.ox
  114.     @status_window.now_hmt.each {|htm|
  115.     htm.VIEWPORT.ox = [ox, current_ox + 16].min if current_ox < ox
  116.     htm.VIEWPORT.ox = [ox, current_ox - 16].max if current_ox > ox }
  117.   end
  118.   #--------------------------------------------------------------------------
  119.   # ● 信息窗口打开时的更新
  120.   #    在状态窗口关闭完成前,信息窗口的打开度设置为 0 。
  121.   #--------------------------------------------------------------------------
  122.   alias update_message_openY update_message_open
  123.   def update_message_open
  124.     update_message_openY
  125.     if !$game_message.busy? && @status_window.close? && !@hmt_vis
  126.       @hmt_vis = true
  127.       @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
  128.     end
  129.     if $game_message.busy? && !@status_window.close? && @hmt_vis
  130.       @hmt_vis = false
  131.       @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = false}
  132.     end
  133.   end
  134.   #--------------------------------------------------------------------------
  135.   # ● 生成状态窗口
  136.   #--------------------------------------------------------------------------
  137.   alias create_status_windowY create_status_window
  138.   def create_status_window
  139.     create_status_windowY
  140.     @hmt_vis = false
  141.     @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = false}
  142.   end
  143.   #--------------------------------------------------------------------------
  144.   # ● 开始选择队友
  145.   #--------------------------------------------------------------------------
  146.   alias select_actor_selectionY select_actor_selection
  147.   def select_actor_selection
  148.     select_actor_selectionY
  149.     @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = false}
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ● 角色[决定]
  153.   #--------------------------------------------------------------------------
  154.   alias on_actor_okY on_actor_ok
  155.   def on_actor_ok
  156.     on_actor_okY
  157.     @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # ● 角色[取消]
  161.   #--------------------------------------------------------------------------
  162.   alias on_actor_cancelY on_actor_cancel
  163.   def on_actor_cancel
  164.     on_actor_cancelY
  165.     @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
  166.   end
  167.   #--------------------------------------------------------------------------
  168.   # ● 开始选择敌人
  169.   #--------------------------------------------------------------------------
  170.   alias select_enemy_selectionY select_enemy_selection
  171.   def select_enemy_selection
  172.     select_enemy_selectionY
  173.     @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = false}
  174.   end
  175.   #--------------------------------------------------------------------------
  176.   # ● 敌方[决定]
  177.   #--------------------------------------------------------------------------
  178.   alias on_enemy_okY on_enemy_ok
  179.   def on_enemy_ok
  180.     on_enemy_okY
  181.     @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
  182.   end
  183.   #--------------------------------------------------------------------------
  184.   # ● 敌方[取消]
  185.   #--------------------------------------------------------------------------
  186.   alias on_enemy_cancelY on_enemy_cancel
  187.   def on_enemy_cancel
  188.     on_enemy_cancelY
  189.     @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
  190.   end
  191.   #--------------------------------------------------------------------------
  192.   # ● 战斗开始
  193.   #--------------------------------------------------------------------------
  194.   alias battle_startY battle_start
  195.   def battle_start
  196.     battle_startY
  197.     @status_window.now_hmt.each {|hmt|hmt.VIEWPORT.visible = true}
  198.   end
  199. end
复制代码
  1. # -----------------------------------------------------------------------------
  2. # ◆全动态插槽(DynamicSlot) By.Clov
  3. # -----------------------------------------------------------------------------
  4. # Ver:1.0.0 Date:2012.02.02
  5. # -16个零件完成
  6. # -23个插件完成
  7. # -----------------------------------------------------------------------------
  8. # ◆Script<DynamicSlot>
  9. # -----------------------------------------------------------------------------
  10. # TYPE:组件 ID:01
  11. # -----------------------------------------------------------------------------
  12. class DynamicSlot
  13.   #--------------------------------------------------------------------------
  14.   # TYPE:设置
  15.   #--------------------------------------------------------------------------
  16.   #边框大小
  17.   FRAME_SIZE = 0
  18.   #边框颜色
  19.   FRAME_COLOR = Color.new(255, 255, 255, 255)
  20.   #背景颜色1
  21.   BACK_COLOR1 = Color.new(0, 0, 0, 255)
  22.   #背景颜色2
  23.   BACK_COLOR2 = Color.new(0, 0, 0, 128)
  24.   #--------------------------------------------------------------------------
  25.   # TYPE:零件 ID:01
  26.   #--------------------------------------------------------------------------
  27.   def initialize(x, y, z, width, height, color1, color2, type = :LR,
  28.     free_sprite = true, value_sprite = true)
  29.     @x = x                                         # 精灵x坐标
  30.     @y = y                                         # 精灵y坐标
  31.     @z = z                                         # 视窗z坐标
  32.     @width = width                                 # 精灵宽
  33.     [url=home.php?mod=space&uid=291977]@height[/url] = height                               # 精灵高
  34.     @width2 = width * 2                            # 精灵宽*2
  35.     @height2 = height * 2                          # 精灵高*2
  36.     @free_sprite = free_sprite                     # 自由精灵是否存在
  37.     @value_sprite = value_sprite                   # 数值精灵是否存在
  38.     @slot_color1 = color1                          # 插槽颜色1
  39.     @slot_color2 = color2                          # 插槽颜色2
  40.     @slot_type = type                              # 插槽类型
  41.     @slot_width = width                            # 插槽的宽
  42.     @slot_opacity = 255                            # 插槽的不透明度
  43.     @slot_move_count = 0                           # 插槽移动计数
  44.     @slot_dynamic = true                           # 插槽动态开关
  45.     @slot_dynamic_speed = 1                        # 插槽动态速度
  46.     @slot_gradually = false                        # 插槽开始渐增减开关
  47.     @slot_gradually_speed = 1                      # 插槽渐增减速度
  48.     @slot_gradually_width = 0                      # 插槽渐增减宽度
  49.     @slot_gradually_value = true                   # 插槽渐增减动态数值开关
  50.     @slot_flash = false                            # 插槽颜色闪烁开关
  51.     @slot_flash_count = 0                          # 插槽颜色闪烁计数
  52.     @slot_flash_time = 40                          # 插槽颜色闪烁帧
  53.     @slot_flash_color = Color.new(0,0,0,0)         # 插槽颜色闪烁颜色
  54.     @slot_fade = false                             # 插槽透明闪烁(渐现)开关
  55.     @slot_fade_show = 5                            # 插槽透明闪烁(渐现)帧渐现值
  56.     #视窗>背景>插槽>边框>数值>自由绘制
  57.     viewport;back;slot;frame;value if value_sprite;free if free_sprite
  58.   end
  59.   #--------------------------------------------------------------------------
  60.   # TYPE:零件 ID:02
  61.   #--------------------------------------------------------------------------
  62.   def viewport
  63.     @vw = (defined? Graphics.width) ? Graphics.width : 640
  64.     @vh = (defined? Graphics.height) ? Graphics.height : 480
  65.     @viewport = Viewport.new(0,0,@vw,@vh);@viewport.z = @z
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # TYPE:零件 ID:03
  69.   #--------------------------------------------------------------------------
  70.   def back
  71.     @back = Sprite.new(@viewport)
  72.     @back.x = @x;@back.y = @y;@back.z = 0
  73.     @back.bitmap = Bitmap.new(@width, @height)
  74.     @back.bitmap.GFR(0, 0, @width, @height, BACK_COLOR1, BACK_COLOR2)
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # TYPE:零件 ID:04
  78.   #--------------------------------------------------------------------------
  79.   def slot
  80.     @slot = Sprite.new(@viewport)
  81.     @slot.x = @x;@slot.y = @y;@slot.z = 1;@slot.opacity = @slot_opacity
  82.     case @slot_type;when:LR;solt_draw_lr;when:UD;solt_draw_ud;end
  83.     @slot_update = "slot_#{@slot_type.to_s.downcase}_update"
  84.   end
  85.   def solt_draw_lr
  86.     @slot.bitmap = Bitmap.new(@width*3, @height)
  87.     @slot.src_rect.set(0,0,@slot_width,@height)
  88.     @slot.bitmap.GFR(0, 0, @width, @height, @slot_color1, @slot_color2)
  89.     @slot.bitmap.GFR(@width, 0, @width, @height, @slot_color2, @slot_color1)
  90.     @slot.bitmap.GFR(@width*2, 0, @width, @height, @slot_color1, @slot_color2)
  91.   end
  92.   def solt_draw_ud
  93.     @slot.bitmap = Bitmap.new(@width, @height*3)
  94.     @slot.src_rect.set(0,0,@slot_width,@height)
  95.     @slot.bitmap.GFR(0, 0, @width, @height, @slot_color1, @slot_color2, true)
  96.     @slot.bitmap.GFR(0, @height, @width, @height, @slot_color2, @slot_color1, true)
  97.     @slot.bitmap.GFR(0, @height*2, @width, @height, @slot_color1, @slot_color2, true)
  98.   end
  99.   #--------------------------------------------------------------------------
  100.   # TYPE:零件 ID:05
  101.   #--------------------------------------------------------------------------
  102.   def frame
  103.     @frame = Sprite.new(@viewport)
  104.     @frame.x = @x-FRAME_SIZE;@frame.y = @y-FRAME_SIZE;@frame.z = 2
  105.     @frame.bitmap = Bitmap.new(@width+FRAME_SIZE*2, @height+FRAME_SIZE*2)
  106.     @frame.bitmap.fill_rect(0, 0, FRAME_SIZE, @height+FRAME_SIZE*2, FRAME_COLOR)
  107.     @frame.bitmap.fill_rect(@width+FRAME_SIZE, 0, FRAME_SIZE, @height+FRAME_SIZE*2, FRAME_COLOR)
  108.     @frame.bitmap.fill_rect(FRAME_SIZE, 0, @width, FRAME_SIZE, FRAME_COLOR)
  109.     @frame.bitmap.fill_rect(FRAME_SIZE, @height+FRAME_SIZE, @width, FRAME_SIZE, FRAME_COLOR)
  110.   end
  111.   #--------------------------------------------------------------------------
  112.   # TYPE:零件 ID:06
  113.   #--------------------------------------------------------------------------
  114.   def free
  115.     @free = Sprite.new(@viewport)
  116.     @free.x = 0;@free.y = 0;@free.z = 3
  117.     @free.bitmap = Bitmap.new(@vw, @vh)
  118.   end
  119.   def free_text(x,y,t,align=0,size=22,bold=nil,italic=nil,color=nil,name=nil)
  120.     @free.bitmap.font.size = size
  121.     @free.bitmap.font.bold = bold if bold != nil
  122.     @free.bitmap.font.italic = italic if italic != nil
  123.     @free.bitmap.font.color = color if color
  124.     @free.bitmap.font.name = name if name
  125.     @free.bitmap.draw_text(x, y, @vw, size, t, align)
  126.   end
  127.   def free_picture(x,y,o,file)
  128.     bitmap = Bitmap.new(file)
  129.     rect =  Rect.new(0, 0, bitmap.width, bitmap.height)
  130.     @free.bitmap.blt(x, y, bitmap, rect, o)
  131.   end
  132.   def free_clear
  133.     @free.bitmap.clear
  134.   end
  135.   #--------------------------------------------------------------------------
  136.   # TYPE:零件 ID:07
  137.   #--------------------------------------------------------------------------
  138.   def value
  139.     @value = Sprite.new(@viewport)
  140.     @value.x = @x;@value.y = @y;@value.z = 3
  141.     @value.bitmap = Bitmap.new(@width2, @height2)
  142.     value_set
  143.   end
  144.   def value_xy(*xy)
  145.     @value.x,@value.y = *xy
  146.   end
  147.   def value_draw(num)
  148.     @value.bitmap.clear
  149.     @value.bitmap.draw_text(0,0,@width2,@value_size,num.to_s,@value_align)
  150.   end
  151.   def value_set(align=0,size=22,bold=nil,italic=nil,color=nil,name=nil)
  152.     @value_align = align
  153.     @value_size = size
  154.     @value.bitmap.font.size = size
  155.     @value.bitmap.font.bold = bold if bold != nil
  156.     @value.bitmap.font.italic = italic if italic != nil
  157.     @value.bitmap.font.color = color if color
  158.     @value.bitmap.font.name = name if name
  159.   end
  160.   #--------------------------------------------------------------------------
  161.   # TYPE:零件 ID:08
  162.   #--------------------------------------------------------------------------
  163.   def value_cur(num)
  164.     @value_cur = num
  165.   end
  166.   def value_max(num)
  167.     @value_max = num
  168.     @value_pix = @value_max / @width.to_f * @slot_gradually_speed
  169.   end
  170.   def value_now
  171.     @value_now = (@slot_width / @width.to_f * @value_max).floor
  172.   end
  173.   #--------------------------------------------------------------------------
  174.   # TYPE:零件 ID:09
  175.   #--------------------------------------------------------------------------
  176.   def slot_width_set(new_width)
  177.     @slot.src_rect.width = [[new_width,@width].min,0].max
  178.     @slot_width = @slot.src_rect.width
  179.     value_draw(@value_cur) if @value_sprite
  180.   end
  181.   def slot_width_push(push_width)
  182.     slot_width_set(@slot_width+push_width)
  183.   end
  184.   #--------------------------------------------------------------------------
  185.   # TYPE:零件 ID:10
  186.   #--------------------------------------------------------------------------
  187.   def slot_gradually_set(new_width)
  188.     @slot_gradually_width = new_width - @slot_width
  189.     @slot_gradually = true
  190.     slot_gradually_value_draw  if @value_sprite
  191.   end
  192.   def slot_gradually_push(push_width)
  193.     @slot_gradually_width += push_width
  194.     @slot_gradually = true
  195.     slot_gradually_value_draw  if @value_sprite
  196.   end
  197.   def slot_gradually_value_draw
  198.     if @slot_gradually_value
  199.       @slot_gradually_value_update = true
  200.       value_now
  201.     else
  202.       @slot_gradually_value_update = false
  203.       value_draw(@value_cur)
  204.     end
  205.   end
  206.   #--------------------------------------------------------------------------
  207.   # TYPE:零件 ID:11
  208.   #--------------------------------------------------------------------------
  209.   def slot_gradually_update
  210.     if @slot_gradually_width != 0
  211.       if @slot_gradually_width < 0
  212.         if @slot_width == 0
  213.           value_draw(@value_cur) if @slot_gradually_value_update
  214.           @slot_gradually_width = 0
  215.           @slot_gradually = false
  216.           return
  217.         end
  218.         speed = @slot_gradually_speed + (@slot_gradually_width.abs % @slot_gradually_speed)
  219.         @slot_gradually_width += speed
  220.         @slot_width = @slot.src_rect.width -= speed
  221.         value_draw((@value_now -= @value_pix).truncate) if @slot_gradually_value_update
  222.       else
  223.         if @slot_width == @width
  224.           value_draw(@value_cur) if @slot_gradually_value_update
  225.           @slot_gradually_width = 0
  226.           @slot_gradually = false
  227.           return
  228.         end
  229.         speed = @slot_gradually_speed + (@slot_gradually_width % @slot_gradually_speed)
  230.         @slot_gradually_width -= speed
  231.         @slot_width = @slot.src_rect.width += speed
  232.         value_draw((@value_now += @value_pix).truncate) if @slot_gradually_value_update
  233.       end
  234.     else
  235.       value_draw(@value_cur) if @slot_gradually_value_update
  236.       @slot_gradually = false
  237.     end
  238.   end
  239.   #--------------------------------------------------------------------------
  240.   # TYPE:零件 ID:12
  241.   #--------------------------------------------------------------------------
  242.   def slot_lr_update
  243.     if @slot_move_count < @width2
  244.       @slot_move_count += @slot_dynamic_speed
  245.       @slot.src_rect.x = @slot_move_count
  246.     else
  247.       @slot_move_count = 0
  248.       @slot.src_rect.x = @width2
  249.     end
  250.   end
  251.   def slot_ud_update
  252.     if @slot_move_count < @height2
  253.       @slot_move_count += @slot_dynamic_speed
  254.       @slot.src_rect.y = @slot_move_count
  255.     else
  256.       @slot_move_count = 0
  257.       @slot.src_rect.y = @height2
  258.     end
  259.   end
  260.   #--------------------------------------------------------------------------
  261.   # TYPE:零件 ID:13
  262.   #--------------------------------------------------------------------------
  263.   def slot_flash_update
  264.     @slot_flash_count += 1
  265.     if @slot_flash_count > @slot_flash_time
  266.       @slot_flash_count = 0
  267.       @slot.flash(@slot_flash_color,@slot_flash_time)
  268.     end
  269.     @slot.update
  270.   end
  271.   #--------------------------------------------------------------------------
  272.   # TYPE:零件 ID:14
  273.   #--------------------------------------------------------------------------
  274.   def slot_fade_update
  275.     if @slot.opacity <= 0
  276.       @slot_fade_show = @slot_fade_show.abs
  277.     end
  278.     if @slot.opacity >= @slot_opacity
  279.       @slot_fade_show = -(@slot_fade_show.abs)
  280.     end
  281.     @slot.opacity += @slot_fade_show
  282.   end
  283.   #--------------------------------------------------------------------------
  284.   # TYPE:零件 ID:15
  285.   #--------------------------------------------------------------------------
  286.   def update
  287.     slot_gradually_update if @slot_gradually
  288.     send(@slot_update) if @slot_dynamic
  289.     slot_flash_update if @slot_flash
  290.     slot_fade_update if @slot_fade
  291.   end
  292.   #--------------------------------------------------------------------------
  293.   # TYPE:零件 ID:16
  294.   #--------------------------------------------------------------------------
  295.   def dispose
  296.     @back.dispose
  297.     @back.bitmap.dispose
  298.     @slot.dispose
  299.     @slot.bitmap.dispose
  300.     @frame.dispose
  301.     @frame.bitmap.dispose
  302.     if @free_sprite;@free.dispose;@free.bitmap.dispose;end
  303.     if @value_sprite;@value.dispose;@value.bitmap.dispose;end
  304.     @viewport.dispose
  305.   end
  306.   #--------------------------------------------------------------------------
  307.   # TYPE:插件 ID:01
  308.   #--------------------------------------------------------------------------
  309.   def slot_dynamic_speed(num)
  310.     @slot_dynamic_speed = num
  311.   end
  312.   def slot_gradually_speed(num)
  313.     @slot_gradually_speed = num
  314.   end
  315.   #--------------------------------------------------------------------------
  316.   # TYPE:插件 ID:02
  317.   #--------------------------------------------------------------------------
  318.   def slot_dynamic(tf)
  319.     @slot_dynamic = tf
  320.   end
  321.   def slot_gradually(tf)
  322.     @slot_gradually = tf
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # TYPE:插件 ID:03
  326.   #--------------------------------------------------------------------------
  327.   def slot_width_ratio(c, m)
  328.     slot_width_set((@width*(c/m.to_f)).round)
  329.   end
  330.   def slot_width_percent(per)
  331.     slot_width_set((@width*(per/100.0)).round)
  332.   end
  333.   #--------------------------------------------------------------------------
  334.   # TYPE:插件 ID:04
  335.   #--------------------------------------------------------------------------
  336.   def slot_gradually_ratio(c, m)
  337.     slot_gradually_set((@width*(c/m.to_f)).round)
  338.   end
  339.   def slot_gradually_percent(per)
  340.     slot_gradually_set((@width*(per/100.0)).round)
  341.   end
  342.   #--------------------------------------------------------------------------
  343.   # TYPE:插件 ID:05
  344.   #--------------------------------------------------------------------------
  345.   def auto_normal_draw(num)
  346.     value_cur(num)
  347.     slot_width_ratio(@value_cur,@value_max)
  348.   end
  349.   def auto_gradually_draw(num)
  350.     value_cur(num)
  351.     slot_gradually_ratio(@value_cur,@value_max)
  352.   end
  353.   #--------------------------------------------------------------------------
  354.   # TYPE:插件 ID:06
  355.   #--------------------------------------------------------------------------
  356.   def solt_hu_change(num)
  357.     @slot.bitmap.hue_change(num)
  358.   end
  359.   #--------------------------------------------------------------------------
  360.   # TYPE:插件 ID:07
  361.   #--------------------------------------------------------------------------
  362.   def solt_get_pixel(*xy)
  363.     @slot.bitmap.get_pixel(*xy)
  364.   end
  365.   #--------------------------------------------------------------------------
  366.   # TYPE:插件 ID:08
  367.   #--------------------------------------------------------------------------
  368.   def solt_set_pixel(*xyc)
  369.     @slot.bitmap.set_pixel(*xyc)
  370.   end
  371.   #--------------------------------------------------------------------------
  372.   # TYPE:插件 ID:09
  373.   #--------------------------------------------------------------------------
  374.   def solt_redraw
  375.     @slot.bitmap.dispose
  376.     send("solt_draw_#{@slot_type.to_s.downcase}")
  377.   end
  378.   #--------------------------------------------------------------------------
  379.   # TYPE:插件 ID:10
  380.   #--------------------------------------------------------------------------
  381.   def slot_type(type)
  382.     @slot_type = type;solt_redraw
  383.     @slot_update = "slot_#{@slot_type.to_s.downcase}_update"
  384.   end
  385.   #--------------------------------------------------------------------------
  386.   # TYPE:插件 ID:11
  387.   #--------------------------------------------------------------------------
  388.   def slot_color1(c)
  389.     @slot_color1 = c
  390.   end
  391.   def slot_color2(c)
  392.     @slot_color2 = c
  393.   end
  394.   #--------------------------------------------------------------------------
  395.   # TYPE:插件 ID:12
  396.   #--------------------------------------------------------------------------
  397.   def slot_opacity(o)
  398.     @slot.opacity = @slot_opacity = o
  399.   end
  400.   #--------------------------------------------------------------------------
  401.   # TYPE:插件 ID:13
  402.   #--------------------------------------------------------------------------
  403.   def slot_flash(tf)
  404.     @slot_flash = tf
  405.   end
  406.   def slot_flash_time(time)
  407.     @slot_flash_time = time
  408.   end
  409.   def slot_flash_color(c)
  410.     @slot_flash_color = c
  411.   end
  412.   #--------------------------------------------------------------------------
  413.   # TYPE:插件 ID:14
  414.   #--------------------------------------------------------------------------
  415.   def slot_fade(tf)
  416.     @slot_fade = tf
  417.   end
  418.   def slot_fade_show(show)
  419.     @slot_fade_show = show
  420.   end
  421.   #--------------------------------------------------------------------------
  422.   # TYPE:插件 ID:15
  423.   #--------------------------------------------------------------------------
  424.   def slot_tone(t)
  425.     @slot.tone = t
  426.   end
  427.   def slot_color(c)
  428.     @slot.color = c
  429.   end
  430.   #--------------------------------------------------------------------------
  431.   # TYPE:插件 ID:16
  432.   #--------------------------------------------------------------------------
  433.   def slot_gradually_value(tf)
  434.     @slot_gradually_value = tf
  435.   end
  436.   #--------------------------------------------------------------------------
  437.   # TYPE:插件 ID:17
  438.   #--------------------------------------------------------------------------
  439.   def angle(num)
  440.     @back.angle = num
  441.     @slot.angle = num
  442.     @frame.angle = num
  443.   end
  444.   #--------------------------------------------------------------------------
  445.   # TYPE:插件 ID:18
  446.   #--------------------------------------------------------------------------
  447.   def blend_type(num)
  448.     @back.blend_type = num
  449.     @slot.blend_type = num
  450.     @frame.blend_type = num
  451.   end
  452.   #--------------------------------------------------------------------------
  453.   # TYPE:插件 ID:19
  454.   #--------------------------------------------------------------------------
  455.   def visible(tf)
  456.     @viewport.visible = tf
  457.   end
  458.   #--------------------------------------------------------------------------
  459.   # TYPE:插件 ID:20
  460.   #--------------------------------------------------------------------------
  461.   def back_opacity(o)
  462.     @back.opacity = o
  463.   end
  464.   def frame_opacity(o)
  465.     @back.opacity = o
  466.   end
  467.   def free_opacity(o)
  468.     @free.opacity = o
  469.   end
  470.   def value_opacity(o)
  471.     @value.opacity = o
  472.   end
  473.   #--------------------------------------------------------------------------
  474.   # TYPE:插件 ID:21
  475.   #--------------------------------------------------------------------------
  476.   def back_visible(tf)
  477.     @back.visible = tf
  478.   end
  479.   def slot_visible(tf)
  480.     @slot.visible = tf
  481.   end
  482.   def frame_visible(tf)
  483.     @frame.visible = tf
  484.   end
  485.   def free_visible(tf)
  486.     @free.visible = tf
  487.   end
  488.   def value_visible(tf)
  489.     @value.visible = tf
  490.   end
  491.   #--------------------------------------------------------------------------
  492.   # TYPE:插件 ID:22
  493.   #--------------------------------------------------------------------------
  494.   def VIEWPORT;@viewport;end
  495.   def SPRITE_BACK;@back;end
  496.   def SPRITE_SLOT;@slot;end
  497.   def SPRITE_FRAME;@frame;end
  498.   def SPRITE_FREE;@free;end
  499.   def SPRITE_VALUE;@value;end
  500.   #--------------------------------------------------------------------------
  501.   # TYPE:插件 ID:23
  502.   #--------------------------------------------------------------------------
  503.   def DynamicSlot_InstanceGet(symbol_instance_name)
  504.     instance_variable_get(symbol_instance_name)
  505.   end
  506.   def DynamicSlot_InstanceSet(symbol_instance_name, setting)
  507.     instance_variable_set(symbol_instance_name, setting)
  508.   end
  509. end
  510. # -----------------------------------------------------------------------------
  511. # ◆Script<GFR>
  512. # -----------------------------------------------------------------------------
  513. # TYPE:组件 ID:02
  514. # -----------------------------------------------------------------------------
  515. class Bitmap
  516.   def GFR(x, y, width, height, color1, color2, vertical = false)
  517.     r1 = color1.red;g1 = color1.green;b1 = color1.blue;o1 = color1.alpha
  518.     r2 = color2.red;g2 = color2.green;b2 = color2.blue;o2 = color2.alpha
  519.     case vertical
  520.     when false
  521.       w = (width-1).to_f;plus_r = (r2-r1)/w;plus_g = (g2-g1)/w
  522.       plus_b = (b2-b1)/w;plus_o = (o2-o1)/w;width.times {|k|
  523.       fill_rect(x+k, y, 1, height, Color.new(r1,g1,b1,o1))
  524.       r1+=plus_r;g1+=plus_g;b1+=plus_b;o1+=plus_o}
  525.     when true
  526.       h = (height-1).to_f;plus_r = (r2-r1)/h;plus_g = (g2-g1)/h
  527.       plus_b = (b2-b1)/h;plus_o = (o2-o1)/h;height.times {|i|
  528.       fill_rect(x, y+i, width, 1, Color.new(r1,g1,b1,o1))
  529.       r1+=plus_r;g1+=plus_g;b1+=plus_b;o1+=plus_o}
  530.     end
  531.   end
  532. end
复制代码
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-11-16 19:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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