Fashy

Ringo Window Show Variable

May 17th, 2020
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.05 KB | None | 0 0
  1. #/==============================================================================\
  2. # Rhyan - Ringo Window Show Variable    
  3. #
  4. # -
  5. # Autor: Davi M, como Rhyan.
  6. # Versão: 1.0
  7. # Começo: 17/05/2020
  8. # Termos de uso:
  9. #
  10. # 1... Você pode usar como quiser, mas dando créditos a: "Ringo Rhyan".
  11. # 2... O uso é para NÂO-COMERCIAL, caso queira utilizar, me contate por mensagem
  12. # privada.
  13. # 3... Válido para não-comercial e comercial: Deixe pelo menos um dos links:
  14. #
  15. # 1>https://github.com/Rhyan-crypto/Rhyan-RGSS3-Scripts
  16. # 2>https://pastebin.com/u/Fashy
  17. # 3>https://centrorpg.com/index.php?action=profile;area=forumprofile
  18. #
  19. # Lembrando que você só precisa deixar apenas UM deles.
  20. #\==============================================================================/
  21.  
  22. module Ringo_Config
  23.   Variable = 1 #<- Altere pelo ID da sua variável.
  24.   Opacidade = 100 #<- Altere pela sua opacidade (0 - 255).
  25. end
  26.  
  27. #===========================================================================#
  28. # Ringo | Scene Map | Essa scene vai ser responsável por carregar a window.
  29. #===========================================================================#
  30.  
  31. class Scene_Map < Scene_Base
  32.  
  33.   include Ringo_Config
  34.  
  35.   alias :ringo_start :start
  36.  
  37.   def start
  38.     ringo_start
  39.     create_code_window
  40.     main_configs
  41.   end
  42.  
  43.   def main_configs
  44.     @ringo_show_variable.opacity = Opacidade
  45.   end
  46.  
  47.   def create_code_window
  48.     @ringo_show_variable = Ringo_Show_Variable.new(Variable)
  49.   end
  50. end
  51.  
  52. #===========================================================================#
  53. # Ringo | Ringo_Show_Variable | Essa é a window (janela que mostra a variável).
  54. #===========================================================================#
  55.  
  56. class Ringo_Show_Variable < Window_Base
  57.   def initialize(var)
  58.     super(0, 0, 150, 50) #x, y, width, height
  59.     refresh
  60.     @var = var
  61.   end
  62.  
  63.   def update
  64.     super
  65.     refresh
  66.   end
  67.  
  68.   def refresh
  69.     contents.clear
  70.     draw_text_ex(0, 0, $game_variables[@var.to_i]) #<- Desenhando o valor da variável.
  71.   end
  72. end
Advertisement
Add Comment
Please, Sign In to add comment