Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def pbDirBoard(text, dir = nil, speed = 16, windowskin = "directionBoard")
- vp = Viewport.new(0, 0, Graphics.width, Graphics.height)
- vp.z = 99999
- sp = {}
- sp[:box] = Sprite.new(vp)
- sp[:box].bitmap = Bitmap.new("Graphics/Windowskins/#{windowskin}")
- sp[:box].y = Graphics.height
- sp[:bmp] = Sprite.new(vp)
- sp[:bmp].bitmap = Bitmap.new(Graphics.width, Graphics.height)
- sp[:bmp].z = 1
- pbSetSystemFont(sp[:bmp].bitmap)
- drawTextEx(sp[:bmp].bitmap,32,Graphics.height - sp[:box].bitmap.height / 2 - 16,
- Graphics.width,2,text,Color.new(64,64,64),Color.new(172,172,172))
- sp[:bmp].y += sp[:box].bitmap.height
- sp[:dir] = Sprite.new(vp)
- begin
- sp[:dir].bitmap = Bitmap.new("Graphics/Pictures/board#{dir}")
- sp[:dir].ox = sp[:dir].bitmap.width
- sp[:dir].oy = sp[:dir].bitmap.height / 2
- sp[:dir].y = Graphics.height - sp[:box].bitmap.height / 2
- sp[:dir].x = Graphics.width - 48
- rescue; end
- sp[:dir].y += sp[:box].bitmap.height
- speed.times do # Intro animation
- Graphics.update
- $scene.updateSpritesets
- sp[:box].y -= sp[:box].bitmap.height / speed
- sp[:bmp].y -= sp[:box].bitmap.height / speed
- sp[:dir].y -= sp[:box].bitmap.height / speed
- end
- loop do # Update input
- Graphics.update
- Input.update
- $scene.updateSpritesets
- break if Input.trigger?(Input::B) || Input.trigger?(Input::C) ||
- Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) ||
- Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT)
- end
- speed.times do # Outro animation
- Graphics.update
- $scene.updateSpritesets
- sp[:box].y += sp[:box].bitmap.height / speed
- sp[:bmp].y += sp[:box].bitmap.height / speed
- sp[:dir].y += sp[:box].bitmap.height / speed
- end
- pbDisposeSpriteHash(sp)
- vp.dispose
- pbWait(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement