Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # // Last Modified :06/08/2011
- #==============================================================================#
- # FRV
- #==============================================================================#
- module FRV
- module_function()
- # Credit to Yanfly for the range to array method
- #--------------------------------------------------------------------------
- # convert_integer_array
- #--------------------------------------------------------------------------
- def convert_integer_array( array )
- result = []
- array.each { |i|
- case i
- when Range; result |= i.to_a
- when Integer; result |= [i]
- end }
- return result
- end
- end
- #==============================================================================#
- # Window_Base
- #==============================================================================#
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # * Draw HP
- # actor : actor
- # x : draw spot x-coordinate
- # y : draw spot y-coordinate
- # width : Width
- #--------------------------------------------------------------------------
- def draw_actor_hp(actor, x, y, width = 120)
- draw_actor_hp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 30, WLH, Vocab::hp_a)
- self.contents.font.color = hp_color(actor)
- last_font_size = self.contents.font.size
- xr = x + width
- self.contents.font.size = 18
- if width < 120
- self.contents.draw_text(xr - 44, y, 44, WLH, actor.hp, 2)
- else
- self.contents.draw_text(xr - 99, y, 44, WLH, actor.hp, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
- self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxhp, 2)
- end
- self.contents.font.size = last_font_size
- end
- #--------------------------------------------------------------------------
- # * Draw MP
- # actor : actor
- # x : draw spot x-coordinate
- # y : draw spot y-coordinate
- # width : Width
- #--------------------------------------------------------------------------
- def draw_actor_mp(actor, x, y, width = 120)
- draw_actor_mp_gauge(actor, x, y, width)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 30, WLH, Vocab::mp_a)
- self.contents.font.color = mp_color(actor)
- last_font_size = self.contents.font.size
- xr = x + width
- self.contents.font.size = 18
- if width < 120
- self.contents.draw_text(xr - 44, y, 44, WLH, actor.mp, 2)
- else
- self.contents.draw_text(xr - 99, y, 44, WLH, actor.mp, 2)
- self.contents.font.color = normal_color
- self.contents.draw_text(xr - 55, y, 11, WLH, "/", 2)
- self.contents.draw_text(xr - 44, y, 44, WLH, actor.maxmp, 2)
- end
- self.contents.font.size = last_font_size
- end
- #--------------------------------------------------------------------------
- # * Draw HP gauge
- # actor : actor
- # x : draw spot x-coordinate
- # y : draw spot y-coordinate
- # width : Width
- #--------------------------------------------------------------------------
- def draw_actor_hp_gauge(actor, x, y, width = 120)
- #gw = width * actor.hp / actor.maxhp
- gc1 = hp_gauge_color1
- gc2 = hp_gauge_color2
- #self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
- #self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- val, max = actor.hp, actor.maxhp
- rect = Rect.new( x, y+WLH-6, width, 4 )
- draw_round_grad_bar( rect, val, max, gc1, gc2, gauge_back_color )
- end
- #--------------------------------------------------------------------------
- # * Draw MP Gauge
- # actor : actor
- # x : draw spot x-coordinate
- # y : draw spot y-coordinate
- # width : Width
- #--------------------------------------------------------------------------
- def draw_actor_mp_gauge(actor, x, y, width = 120)
- #gw = width * actor.mp / [actor.maxmp, 1].max
- gc1 = mp_gauge_color1
- gc2 = mp_gauge_color2
- #self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
- #self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- val, max = actor.mp, actor.maxmp
- rect = Rect.new( x, y+WLH-6, width, 4 )
- draw_round_grad_bar( rect, val, max, gc1, gc2, gauge_back_color )
- end
- end
- #==============================================================================#
- # FRV::Container_Base
- #==============================================================================#
- class FRV::Container_Base
- #--------------------------------------------------------------------------#
- # * Public Instance Variables
- #--------------------------------------------------------------------------#
- attr_accessor :x
- attr_accessor :y
- attr_accessor :z
- attr_accessor :width
- attr_accessor :height
- attr_accessor :opacity
- attr_accessor :index
- attr_accessor :item_max
- attr_accessor :active
- #--------------------------------------------------------------------------#
- # * overwrite method :initialize
- #--------------------------------------------------------------------------#
- def initialize( x=0, y=0, width=0, height=0 )
- @x, @y, @z, @width, @height, @opacity = x, y, 0, width, height, 255
- @index, @item_max = 0, 0
- @active = true
- end
- end
- #=*==========================================================================*=#
- # ** END OF FILE
- #=*==========================================================================*=#
Advertisement
Add Comment
Please, Sign In to add comment