Wenn du LDT_Window_HPBar hiermit ersetzt: Code: class LDT_Window_HPBar < Window_Base HP_WIDTH = 20 HP_HEIGHT = 100 BORDER_WIDTH = 6 BORDER_COLOR = 1 BORDER_CURVE = 1 HP_COLOR = 3 BACKGROUND_COLOR = 2 def initialize(x,y,th=nil) @hp_height = th ? th : HP_HEIGHT @hp_height = @hp_height - BORDER_WIDTH*2 super(x,y,HP_WIDTH+BORDER_WIDTH*2,@hp_height+BORDER_WIDTH*2) @hp = 0 @max_hp = 0 end def set_hp(hp,maxhp) trefresh = (hp != @hp || maxhp != @max_hp) ? true : false @hp = hp + 0.0 @max_hp = maxhp + 0.0 refresh if(trefresh) end def refresh contents.clear th = (@hp / @max_hp * @hp_height).to_i ty2 = @hp_height - th contents.fill_rect(BORDER_WIDTH, BORDER_WIDTH, HP_WIDTH, @hp_height, text_color(BACKGROUND_COLOR)) contents.fill_rect(BORDER_WIDTH, BORDER_WIDTH + ty2, HP_WIDTH, th, text_color(HP_COLOR)) BORDER_CURVE.times do |tp| ttc = BORDER_CURVE - tp ttx = BORDER_WIDTH ttw = HP_WIDTH - ttc * 2 #upper edges tth = BORDER_WIDTH + tp contents.clear_rect(ttx, tth, ttc , 1) contents.clear_rect(BORDER_WIDTH+HP_WIDTH-ttc, tth, ttc , 1) #lower edges tth = @hp_height + BORDER_WIDTH - tp contents.clear_rect(ttx, tth, ttc , 1) contents.clear_rect(BORDER_WIDTH+HP_WIDTH-ttc, tth, ttc , 1) end end def standard_padding return 0 end end Sind auch die Pixel in den Ecken abgerundet.
class LDT_Window_HPBar < Window_Base HP_WIDTH = 20 HP_HEIGHT = 100 BORDER_WIDTH = 6 BORDER_COLOR = 1 BORDER_CURVE = 1 HP_COLOR = 3 BACKGROUND_COLOR = 2 def initialize(x,y,th=nil) @hp_height = th ? th : HP_HEIGHT @hp_height = @hp_height - BORDER_WIDTH*2 super(x,y,HP_WIDTH+BORDER_WIDTH*2,@hp_height+BORDER_WIDTH*2) @hp = 0 @max_hp = 0 end def set_hp(hp,maxhp) trefresh = (hp != @hp || maxhp != @max_hp) ? true : false @hp = hp + 0.0 @max_hp = maxhp + 0.0 refresh if(trefresh) end def refresh contents.clear th = (@hp / @max_hp * @hp_height).to_i ty2 = @hp_height - th contents.fill_rect(BORDER_WIDTH, BORDER_WIDTH, HP_WIDTH, @hp_height, text_color(BACKGROUND_COLOR)) contents.fill_rect(BORDER_WIDTH, BORDER_WIDTH + ty2, HP_WIDTH, th, text_color(HP_COLOR)) BORDER_CURVE.times do |tp| ttc = BORDER_CURVE - tp ttx = BORDER_WIDTH ttw = HP_WIDTH - ttc * 2 #upper edges tth = BORDER_WIDTH + tp contents.clear_rect(ttx, tth, ttc , 1) contents.clear_rect(BORDER_WIDTH+HP_WIDTH-ttc, tth, ttc , 1) #lower edges tth = @hp_height + BORDER_WIDTH - tp contents.clear_rect(ttx, tth, ttc , 1) contents.clear_rect(BORDER_WIDTH+HP_WIDTH-ttc, tth, ttc , 1) end end def standard_padding return 0 end end
--
Foren-Regeln