Advertisement
manunited668

Untitled

Oct 23rd, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. def pbDirBoard(text, dir = nil, speed = 16, windowskin = "directionBoard")
  2. vp = Viewport.new(0, 0, Graphics.width, Graphics.height)
  3. vp.z = 99999
  4. sp = {}
  5. sp[:box] = Sprite.new(vp)
  6. sp[:box].bitmap = Bitmap.new("Graphics/Windowskins/#{windowskin}")
  7. sp[:box].y = Graphics.height
  8. sp[:bmp] = Sprite.new(vp)
  9. sp[:bmp].bitmap = Bitmap.new(Graphics.width, Graphics.height)
  10. sp[:bmp].z = 1
  11. pbSetSystemFont(sp[:bmp].bitmap)
  12. drawTextEx(sp[:bmp].bitmap,32,Graphics.height - sp[:box].bitmap.height / 2 - 16,
  13. Graphics.width,2,text,Color.new(64,64,64),Color.new(172,172,172))
  14. sp[:bmp].y += sp[:box].bitmap.height
  15. sp[:dir] = Sprite.new(vp)
  16. begin
  17. sp[:dir].bitmap = Bitmap.new("Graphics/Pictures/board#{dir}")
  18. sp[:dir].ox = sp[:dir].bitmap.width
  19. sp[:dir].oy = sp[:dir].bitmap.height / 2
  20. sp[:dir].y = Graphics.height - sp[:box].bitmap.height / 2
  21. sp[:dir].x = Graphics.width - 48
  22. rescue; end
  23. sp[:dir].y += sp[:box].bitmap.height
  24. speed.times do # Intro animation
  25. Graphics.update
  26. $scene.updateSpritesets
  27. sp[:box].y -= sp[:box].bitmap.height / speed
  28. sp[:bmp].y -= sp[:box].bitmap.height / speed
  29. sp[:dir].y -= sp[:box].bitmap.height / speed
  30. end
  31. loop do # Update input
  32. Graphics.update
  33. Input.update
  34. $scene.updateSpritesets
  35. break if Input.trigger?(Input::B) || Input.trigger?(Input::C) ||
  36. Input.trigger?(Input::UP) || Input.trigger?(Input::DOWN) ||
  37. Input.trigger?(Input::LEFT) || Input.trigger?(Input::RIGHT)
  38. end
  39. speed.times do # Outro animation
  40. Graphics.update
  41. $scene.updateSpritesets
  42. sp[:box].y += sp[:box].bitmap.height / speed
  43. sp[:bmp].y += sp[:box].bitmap.height / speed
  44. sp[:dir].y += sp[:box].bitmap.height / speed
  45. end
  46. pbDisposeSpriteHash(sp)
  47. vp.dispose
  48. pbWait(1)
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement