Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ~ Akian~RGSS3 ~
- # Nombre del script: AR3 ~ Syntax
- # Scripter: Akian~RGSS3
- # Requiere?: Nada :3
- # Versión: 1.4
- # Historial:
- # 1.0 Comienzo y Finalización del script
- # 1.1 Posibilidad de cambiar el texto mediante script call
- # 1.2 Mejora de frames
- # 1.3 Edición de fuente y tamaño
- # 1.4 Mejora del modulo
- # Este script se cambió totalmente desde la versión 1.1
- # Antes solo mostraba un texto pero ahora te da la posibilidad
- # de cambiar ese texto por medio de un script call
- # Setea el texto que quieras mostrar y la posición en la region editable
- # luego con los siguientes scripts calls podrás cambiar el texto en el momento
- # que lo necesites
- # ~ ~ Script Call ~ ~
- # change_syntax_text("Texto") Cambia el primer texto mostrado
- # change_syntax_text_2("Texto") Cambia el segundo texto mostrado
- #==============================================================================
- # Condiciones de uso:
- # Puedes usar libremente este script en proyectos comerciales y no comerciales
- # Los créditos son requeridos, por el trabajo, el esfuerzo, el sudor, bueno no
- # tanto por el sudor.
- # Si posteas este script en algún foro debes señalar la página oficial
- # http://akianzax.wix.com/akian-rgss3
- # También nombrar la página en los créditos si lo usas para un proyecto.
- #==============================================================================
- $imported = {} if $imported.nil?
- $imported["AR3_Syntax"] = true
- module AR3
- module SYNTAX
- #==============================================================================
- #
- # REGION EDITABLE
- #
- #==============================================================================
- FONT_NAME = "Comic Sans Ms" # Fuente
- FONT_SIZE = 18 # Tamaño de fuente
- # Texto x y
- LINEA1 = ["Texto texto texto", 0, -35]
- LINEA2 = [nil, 0, -15]
- # Dejar nil en el texto si no se quiere poner nada o simplemente ""
- COLOR1 = 18 # Color de la linea 1
- COLOR2 = 18 # Color de la linea 2
- # Colores 0 = Blanco || 1 = Celeste || 2 = Rojo || 3 = Verde || 4 = Celeste(Claro)
- # 5 = Lila || 6 = Amarillo || 7 = Gris(Oscuro) || 8 = Gris || 9 = Azul
- # 10 = Rojo(Fuerte) || 11 = Verde(Fuerte) || 12 = Azul(Fuerte) || 13 = Violeta
- # 14 = Naranja || 15 = Negro || 16 = Lila(Suave) || 17 = Amarillo
- # 18 = Rojo || 19 = Negro || 20 = Marron || 21 = Marron(Claro) || 22 = Azul(Agua)
- # 23 = Celeste(Fuerte) || 24 = Verde(Claro) || 25 = Marron(Raro)
- # 26 = Violeta || 27 = Rosado || 28 = Verde(Fuerte) || 29 = Verde(Claro)
- # 30 = Violeta(Fuerte) || 31 = Violeta(Suave)
- # Esto teniendo el windowskin normal, con otros puede ser igual o no, prueben.
- SWITCH_ID = 5 # Switch que activará y desactivará el script
- # Dejarlo en cero para usarlo siempre
- #==============================================================================
- #
- # FIN DE LA REGION EDITABLE
- #
- #==============================================================================
- end
- end
- # Tocarás algo a partir de aquí?
- # Pium pium, muere muere.
- #==============================================================================
- # ** Scene_Map
- #------------------------------------------------------------------------------
- # This class performs the map screen processing.
- #==============================================================================
- class Scene_Map < Scene_Base
- # Incluyendo modulo
- include AR3::SYNTAX
- # Método de alias
- alias akian_syntax_start_zack start
- alias akian_syntax_update_zack update
- #--------------------------------------------------------------------------
- # ▼ Proceso de comienzo
- #--------------------------------------------------------------------------
- def start
- akian_syntax_start_zack
- create_syntax_window
- end
- #--------------------------------------------------------------------------
- # ▼ Seteando Syntax Window
- #--------------------------------------------------------------------------
- def create_syntax_window
- @syntax_text = Window_Syntax.new
- @syntax_text.set_texto
- @syntax_text.visible = $game_switches[AR3::SYNTAX::SWITCH_ID] || AR3::SYNTAX::SWITCH_ID == 0
- end
- #--------------------------------------------------------------------------
- # ▼ Actualización
- #--------------------------------------------------------------------------
- def update
- akian_syntax_update_zack
- syntax_update
- end
- def syntax_update
- @syntax_text.visible = $game_switches[AR3::SYNTAX::SWITCH_ID] || AR3::SYNTAX::SWITCH_ID == 0
- @syntax_text.set_texto
- return
- end
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Class Window
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- class Window_Syntax < Window_Base
- #--------------------------------------------------------------------------
- # ▼ Proceso de initialize
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, Graphics.width, 100)
- self.opacity = 0
- end
- #--------------------------------------------------------------------------
- # ▼ Frame Update
- #--------------------------------------------------------------------------
- def update
- end
- #--------------------------------------------------------------------------
- # ▼ Seteando texto
- #--------------------------------------------------------------------------
- def set_texto
- contents.font.name = AR3::SYNTAX::FONT_NAME
- contents.font.size = AR3::SYNTAX::FONT_SIZE
- contents.clear
- change_color(text_color(AR3::SYNTAX::COLOR1))
- draw_text($game_system.syntax_text_1, AR3::SYNTAX::LINEA1[1], AR3::SYNTAX::LINEA1[2], Graphics.width, 100, 0)
- change_color(text_color(AR3::SYNTAX::COLOR2))
- draw_text($game_system.syntax_text_2, AR3::SYNTAX::LINEA2[1], AR3::SYNTAX::LINEA2[2], Graphics.width, 100, 0)
- end
- #--------------------------------------------------------------------------
- # ▼ Dibujando el texto
- #--------------------------------------------------------------------------
- def draw_text(text, x, y, width, height, alignment)
- contents.draw_text(x, y, width, height, text, alignment)
- end
- end
- #==============================================================================
- # ▼ Game_System
- #------------------------------------------------------------------------------
- # This class handles system data. It saves the disable state of saving and
- # menus. Instances of this class are referenced by $game_system.
- #==============================================================================
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Class Game_System
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- class Game_System
- alias akian_initialize_zack initialize
- #--------------------------------------------------------------------------
- # ▼ Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :syntax_text_1 # Texto 1
- attr_accessor :syntax_text_2 # Texto 2
- #--------------------------------------------------------------------------
- # ▼ Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- @syntax_text_1 = AR3::SYNTAX::LINEA1[0]
- @syntax_text_2 = AR3::SYNTAX::LINEA2[0]
- akian_initialize_zack
- end
- end
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Class Game_System
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- class Game_Interpreter
- def change_syntax_text(text)
- return unless text.is_a?(String)
- $game_system.syntax_text_1 = text
- end
- def change_syntax_text_2(text)
- return unless text.is_a?(String)
- $game_system.syntax_text_2 = text
- end
- end
- #===============================================================================
- #
- # ▼ Fin del mundo, acá se acaba todo
- # ~ Akián RGSS3 ~
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment