[Script] [ACE] [VXA yêu cầu] Script Map Title

2»

Comments

  • dsiver144dsiver144 Posts: 1,064Registered
    Focker_c wrote:
    Fix lại theo kiểu call switch dùm đc ko ? Để làm một cái mẫu nhìn vào đấy mò

    On Off Switch 57 để bật tắt hud :) Có thể sửa thành switch khác trong line 42
    #==============================================================================
    # Window Map Name+
    # by Enterbrain
    # edited by LUSHI
    # Date 04/04/2012
    #------------------------------------------------------------------------------
    # **WHAT IT DOES**
    #   This edit is simple I'm no pro but wanted my have my one image in the
    #   background of the map name so I edited Window_MapName.
    #   This adds a background image to the map name and moves it to the right of the
    #   screen.
    #------------------------------------------------------------------------------
    # **WHERE THINGS GO**
    #   place this scrip ether in the materials section or overright Window_MapName
    #   with this one. If using the map name fix By Crazyninjaguy place this above it.
    #
    #   Must have "Map_Name_Back.png" in Graphics/System folder
    #
    #   thats it run your game.
    #
    #------------------------------------------------------------------------------
    # **HOW TO EDIT**
    #   To change the locaton of the name change the values of lines,
    #
    #   49
    #   122
    #   123
    #
    #   to change the name of the png file find line,
    #
    #   120
    #
    #   and edit as you need.
    #
    # **THE END**
    #   Thats all there is. I hope That helps.
    #------------------------------------------------------------------------------
    #  This window displays the map name.
    #==============================================================================
    module Addon
      #=============================================================================
          Enable_Switch = 57 # Tùy chỉnh switch bật tắt Hud
      #=============================================================================
    end
    class Window_MapName < Window_Base
      #--------------------------------------------------------------------------
      # * Object Initialization
      #--------------------------------------------------------------------------
      def initialize
    	super(0, 0, window_width, fitting_height(1))
    	self.opacity = 0
    	self.contents_opacity = 0
    	self.x = 340
    	@map_name_back = Sprite.new
    	@show_count = 0
    	refresh
      end
      #--------------------------------------------------------------------------
      # * Get Window Width
      #--------------------------------------------------------------------------
      def window_width
    	return 240
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
    	super
    	if @show_count > 0 && $game_map.name_display
    	  update_fadein
    	  @show_count -= 1
    	else
    	  update_fadeout
    	end
      end
      #--------------------------------------------------------------------------
      # * Update Fadein
      #--------------------------------------------------------------------------
      def update_fadein
    	self.contents_opacity += 16
    	@map_name_back.opacity += 16
      end
      #--------------------------------------------------------------------------
      # * Update Fadeout
      #--------------------------------------------------------------------------
      def update_fadeout
    	self.contents_opacity -= 16
    	@map_name_back.opacity -= 16
      end
      #--------------------------------------------------------------------------
      # * Open Window
      #--------------------------------------------------------------------------
      def open
    	refresh
    	@show_count = 150
    	self.contents_opacity = 0
    	self
      end
      #--------------------------------------------------------------------------
      # * Close Window
      #--------------------------------------------------------------------------
      def close
    	@show_count = 0
    	self
      end
      #--------------------------------------------------------------------------
      # * Refresh
      #--------------------------------------------------------------------------
      def refresh
    	contents.clear
    	if $game_switches[Addon::Enable_Switch] == true
          unless $game_map.display_name.empty?
              draw_background(contents.rect)
              draw_text(contents.rect, $game_map.display_name, 1)
            end
            end
      end
      #--------------------------------------------------------------------------
      # * Draw Background
      #--------------------------------------------------------------------------
      def draw_background(rect)
    	temp_rect = rect.clone
    	temp_rect.width /= 2
    	contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
    	@map_name_back = Sprite.new
    	@map_name_back.bitmap = Cache.system("Map_Name_Back.png")
    	@map_name_back.z = 0
    	@map_name_back.x = 370
    	@map_name_back.y = 7
    	@map_name_back.opacity = 0
    	temp_rect.x = temp_rect.width
    	contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
      end
      #--------------------------------------------------------------------------
      # * Get Background Color 1
      #--------------------------------------------------------------------------
      def back_color1
    	Color.new(0, 0, 0, 0)
      end
      #--------------------------------------------------------------------------
      # * Get Background Color 2
      #--------------------------------------------------------------------------
      def back_color2
    	Color.new(0, 0, 0, 0)
      end
    end
    
  • Focker_cFocker_c Posts: 1,577Registered
    Oh` , cảm ơn nhé
    Thì ra thêm 1 yêu cầu :
    if $game_switches[Addon::Enable_Switch] == true
    Biết thế nhưng cũng chẳng biết xài làm sao.
  • NagiNagi Posts: 589Registered
    Focker_c wrote:
    Oh` , cảm ơn nhé
    Thì ra thêm 1 yêu cầu :
    if $game_switches[Addon::Enable_Switch] == true
    Biết thế nhưng cũng chẳng biết xài làm sao.
    Cái Switch đó mà ON thì tên map mới hiện và ngược lại. Def refresh dùng để update mỗi frame.
  • Focker_cFocker_c Posts: 1,577Registered
    Cách áp dụng thì có gì đâu, cho switch 57 on là đc
    Ý là bảo qua đó ko học đc gì :D
    Thì ra "Def refresh dùng để update mỗi frame." :D
Sign In or Register to comment.