Advertisement
Black_Mage

Balloon Icon Offset Script

Aug 6th, 2022 (edited)
1,621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.70 KB | None | 0 0
  1. #==============================================================================
  2. # Balloon Icon Offset Script by Black Mage.
  3. # For: RPG Maker VX Ace
  4. # Version: 1.0
  5. #
  6. # License: CC-BY 3.0
  7. # https://burningwizard.wordpress.com/
  8. #==============================================================================
  9.  
  10. #==============================================================================
  11. # Changelog
  12. #==============================================================================
  13. # Version 1.0
  14. #   - Initial version.
  15. #==============================================================================
  16.  
  17. #------------------------------------------------------------------------------
  18. # * Beyond this is the sacred land of code. You need programming qualification
  19. #   to delve deeper, or it'll cause many unnecessary problems. Proceed at your
  20. #   own risk.
  21. #------------------------------------------------------------------------------
  22.  
  23. module BLACK
  24.  
  25.   # The variable that will be used as balloon icon X offset.
  26.   BALLOON_X_OFFSET_VARIABLE = 32
  27.  
  28.   # The variable that will be used as balloon icon Y offset.
  29.   BALLOON_Y_OFFSET_VARIABLE = 33
  30.  
  31. end
  32. class Sprite_Character < Sprite_Base
  33.   include BLACK
  34.   def update_balloon
  35.     if @balloon_duration > 0
  36.       @balloon_duration -= 1
  37.       if @balloon_duration > 0
  38.         @balloon_sprite.x = x + $game_variables[BALLOON_X_OFFSET_VARIABLE]
  39.         @balloon_sprite.y = y - height + $game_variables[BALLOON_Y_OFFSET_VARIABLE]
  40.         @balloon_sprite.z = z + 200
  41.         sx = balloon_frame_index * 32
  42.         sy = (@balloon_id - 1) * 32
  43.         @balloon_sprite.src_rect.set(sx, sy, 32, 32)
  44.       else
  45.         end_balloon
  46.       end
  47.     end
  48.   end
  49. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement