Custom meter problem
#13
Well, I guess you couldn't rotate THAT windowskin. So.....

Added this value:
Code:
HP_Meter_Fill = false

And here's the revision:
Code:
#--------------------------------------------------------------------------
  # * Draw HP
  #     actor : actor
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     width : draw spot width
  #--------------------------------------------------------------------------
  alias draw_actor_hp_bar draw_actor_hp
  def draw_actor_hp(actor, x, y, width = 144)
    # Set Bar Position
    bar_x = HP_Pos_Adjust[0] + x
    bar_y = HP_Pos_Adjust[1] + y + (Font.default_size * 2 /3)
    # Acquire bar image and dimensions
    bar_img     = RPG::Cache.windowskin(HP_Meter)
    bar_width   = bar_img.width
    bar_height  = bar_img.height / 3
    # Define source rectangle for bar
    src_rect = Rect.new(0, 0, bar_width, bar_height)
    self.contents.blt(bar_x, bar_y, bar_img, src_rect)
    # Determine which line used in bar image
    self.contents.blt(bar_x, bar_y, bar_img, src_rect)
    # Determine which line used in bar image
    bar_line    = (actor.hp == actor.maxhp) ? 2 : 1
    # Calculate value to adjust drawn line
    bar_start   = bar_line * bar_height
    bar_amount  = bar_height * (actor.hp.to_f / actor.maxhp.to_f)
    # Decide if fill from top or bottom
    diff = (HP_Meter_Fill) ? 0 : bar_height - bar_amount
    # Adjust dimensions of destination rectangle
    src_rect2 = Rect.new( 0, bar_start+diff, bar_width, bar_amount)
    # Draw the bar with the new Rectangle area
    self.contents.blt(bar_x, bar_y+diff, bar_img, src_rect2)
    # Perform the original call
    draw_actor_hp_bar(actor, x, y, width)
  end

The true/false value I added lets the hearts fill from the bottom up, or top down. :)

And with this model, you can adjust the others.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Messages In This Thread
Custom meter problem - by daylights - 08-10-2013, 03:59 PM
RE: Custom meter problem - by Ace - 08-10-2013, 05:00 PM
RE: Custom meter problem - by daylights - 08-10-2013, 08:10 PM
RE: Custom meter problem - by Ace - 08-10-2013, 10:51 PM
RE: Custom meter problem - by daylights - 08-11-2013, 01:59 AM
RE: Custom meter problem - by Ace - 08-11-2013, 04:48 PM
RE: Custom meter problem - by DerVVulfman - 08-11-2013, 05:38 PM
RE: Custom meter problem - by daylights - 08-11-2013, 06:23 PM
RE: Custom meter problem - by DerVVulfman - 08-11-2013, 06:48 PM
RE: Custom meter problem - by daylights - 08-11-2013, 07:04 PM
RE: Custom meter problem - by DerVVulfman - 08-11-2013, 08:04 PM
RE: Custom meter problem - by daylights - 08-11-2013, 08:16 PM
RE: Custom meter problem - by DerVVulfman - 08-12-2013, 03:20 AM
RE: Custom meter problem - by daylights - 08-12-2013, 03:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   ForeverZer0 Custom Resolution + Littledrago's Zoom Solitaire 20 1,192 10-27-2024, 09:32 PM
Last Post: Solitaire
   Resources Consumption Meter Whisper 6 2,799 05-29-2023, 03:51 PM
Last Post: Whisper
   The z-space problem of displaying sprites icogil 28 12,630 03-05-2023, 03:31 AM
Last Post: DerVVulfman
   ACBS - Atoa Custom Battle System and TP System zlsl 2 4,567 10-20-2021, 05:09 AM
Last Post: zlsl
   I want to add an Atoa Custom Battle System command cut-in. zlsl 11 13,887 11-11-2019, 08:55 PM
Last Post: DerVVulfman
   Question about ACBS (Atoa Custom Battle System) aeliath 10 12,757 08-08-2019, 02:50 PM
Last Post: aeliath
   Problems with counteraatack addon of Atoa Custom Battle System Djigit 22 35,447 01-05-2017, 08:05 PM
Last Post: Noctis
   Custom Message by Hodgeelmf, need to make it above picture LunarBerry 6 11,010 05-09-2016, 01:15 AM
Last Post: LunarBerry
   Atoa Custom Battle System: Popup when status change Noctis 6 10,624 02-01-2016, 12:52 AM
Last Post: Noctis
   Atoa Custom Battle System CTB animation while cast Noctis 6 10,704 01-04-2016, 03:05 PM
Last Post: Noctis



Users browsing this thread: 4 Guest(s)