Advertisement
dsiver144

Custom Window Message Show Up

Mar 9th, 2017
901
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. #==============================================================================
  2. # * Custom Window Message Show Up
  3. # by dsiver144
  4. #==============================================================================
  5. class Window_Message
  6. #--------------------------------------------------------------------------
  7. # * alias method: update_placement
  8. #--------------------------------------------------------------------------
  9. alias_method(:dsiver_update_placement, :update_placement)
  10. def update_placement
  11. dsiver_update_placement()
  12. self.opacity = 0
  13. open_and_wait
  14. des_y = @position * (Graphics.height - height) / 2
  15. self.y = des_y + height
  16. contents.clear
  17. self.contents_opacity = 255
  18. while self.y > des_y
  19. self.y -= 10
  20. self.opacity += 20
  21. Fiber.yield
  22. end
  23. end
  24. #--------------------------------------------------------------------------
  25. # * alias method: close_and_wait
  26. #--------------------------------------------------------------------------
  27. alias_method(:dsiver_close_and_wait, :close_and_wait)
  28. def close_and_wait
  29. des_y = @position * (Graphics.height - height) / 2 + height
  30. while self.y < des_y
  31. self.y += 10
  32. self.opacity -= 20
  33. self.contents_opacity -= 20
  34. Fiber.yield
  35. end
  36. dsiver_close_and_wait
  37. end
  38. end # Window_Message
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement