Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Completion Bar? (Just a bar actually)
#1
Completion Bar? (Just a bar actually)
by sasuke89
Sep 2 2006

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


I made a bar!!!!!!.... My first bar.... Okay this doesn't really do anything. Just shows a bar.... if you put $completion = #number here... in a call script the bar goes up....


This is VERSION 1.... Gonna put it in my Menu in a minute

Code:
class Scene_Complete
  def main
    @completewindow = Window_Completion.new
    @completewindow.y = 0
    @completewindow.x = 0
    Graphics.transition
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame Update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end

    Graphics.freeze
    @completewindow.dispose
  end

#Update

def update
    # Update windows
    @completewindow.update
    #@window.update
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
  end
end


module KGC
  
  # Overdrive gauge maximum.
  CB_GAUGE_MAX = 100
end
class Window_Completion < Window_Base
  def initialize
    super(0,0,640,480)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    draw_actor_cb(88, 120)#$game_party.actors[i], i * 160 + 4,
  end
  def draw_actor_cb(x, y, width = 480)#actor,
    rate = $completion.to_f / KGC::CB_GAUGE_MAX
    plus_x = 0
    rate_x = 0
    plus_y = 25
    plus_width = 0
    rate_width = 100
    height = 16
    align1 = 1
    align2 = 2
    align3 = 0
    grade1 = 1
    grade2 = 0
    color1 = Color.new(0, 0, 0, 192)
    color2 = Color.new(255, 255, 192, 192)
    color3 = Color.new(0, 0, 0, 192)
    color4 = Color.new(64, 0, 0, 192)
    color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
    color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)
    cb = (width + plus_width) * $completion.to_f * rate_width / 100 /
      KGC::CB_GAUGE_MAX
    gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
    width, plus_width + width * rate_width / 100,
    height, cb, align1, align2, align3,
    color1, color2, color3, color4, color5, color6, grade1, grade2)
  end
end

Show the Window with a call script

$scene = Scene_Complete.new
}




Users browsing this thread: