Advertisement
TechSkylander1518

Load Screen

Aug 10th, 2022
1,115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.23 KB | None | 0 0
  1. class LoadScene
  2.  
  3.   def initialize
  4.     @viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
  5.     @sprites = {}
  6.     @sprites["bg"] = BitmapSprite.new(Graphics.width,Graphics.height,@viewport)
  7.     @sprites["bg"].bitmap.fill_rect(0,0,Graphics.width,Graphics.height,Color.new(239,81,189))
  8.     @sprites["databox"] = Sprite.new(@viewport)
  9.     @sprites["databox"].bitmap = Bitmap.new("Graphics/Pictures/Battle/databox_thin")
  10.     @sprites["databox"].ox = @sprites["databox"].bitmap.width/2
  11.     @sprites["databox"].oy = @sprites["databox"].bitmap.height/2
  12.     @sprites["databox"].x = Graphics.width/2
  13.     @sprites["databox"].y = Graphics.height/2    
  14.     @sprites["loadbar"] = IconSprite.new(@sprites["databox"].x+6,@sprites["databox"].y+9, @viewport)
  15.     @sprites["loadbar"].setBitmap(sprintf("Graphics/Pictures/Battle/overlay_hp"))
  16.     @sprites["loadbar"].src_rect.set(0, 0, 6, 6)
  17.     main
  18.   end
  19.  
  20.   def main
  21.     loop do
  22.       @sprites["loadbar"].src_rect.width += 2
  23.       Graphics.update
  24.       break if @sprites["loadbar"].src_rect.width == 96
  25.     end
  26.     pbWait(20)
  27.     dispose
  28.     pbWait(5)
  29.     $game_system.menu_disabled=false
  30.   end
  31.  
  32.   def dispose
  33.     pbDisposeSpriteHash(@sprites)
  34.     @viewport.dispose
  35.   end
  36.  
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement