Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if false # << Make true to use this script, false to disable.
- #===============================================================================
- #
- # ☆ $D13x - Key Menu HUD
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy / Normal
- # -- Requires : $D13x Key Menu v1.1+
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Key_Menu]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 29/o3/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script shows a little HUD for the keys used to trigger each menu item.
- # Requires $D13x Key Menu.
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- # Place Below $D13x Key Menu
- #
- #===============================================================================
- module Key_Menu
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ Visible HUD Settings
- #-----------------------------------------------------------------------------
- # You can show a small graphic for each hud item,
- # NOTE : the graphic should be about 26x26 pixels in size
- # it will be shown below the icon for all visible key icons.
- # graphic should be placed in Graphics/System folder
- Show_HUD_Graphic = [ false , "GRAPHIC NAME" ] # [ use? , graphic ]
- # Text Settings, used to adjust various settings for the Key shown
- # for each visible menu icon.
- # Settings = [ x , y , size, bold , color , outline col ]
- Text_Settings = [ 26 , 5 , 18 , true , Text_Color::Grey, Text_Color::Black ]
- Text_Opacity = [ 155 , 255 ] # [ not pressed , pressed ]
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # ☆ Visible Icon Settings
- #-----------------------------------------------------------------------------
- # NOTE: will only be shown if the key is not :NONE
- # Menu Item = [show?, x , y , icon , icon hue]
- Menu_Key_HUD = [true , 0 , 0 , 0 , 0 ]
- Pause_Key_HUD = [true , 10 , 100 , 1 , 0 ]
- Items_Key_HUD = [true , 10 , 126 , 2 , 0 ]
- Skills_Key_HUD = [true , 10 , 152 , 3 , 0 ]
- Equips_Key_HUD = [true , 10 , 178 , 4 , 0 ]
- Status_Key_HUD = [true , 10 , 204 , 5 , 0 ]
- Save_Key_HUD = [true , 10 , 230 , 6 , 0 ]
- # This is the extra x and y position added to each icon.
- Icon_Settings = [ 2 , 2 ] # [ xtra x , xtra y ]
- end #####################
- # CUSTOMISATION END #
- #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- class KM_HUD < Sprite
- #===============================================================================
- #--------------------------------------------------------------------------
- # Initalize Litte Key HUD
- #--------------------------------------------------------------------------
- def initialize(key,x,y,icon_id,hue)
- super()
- create_bg(x,y)
- create_icon(x,y,icon_id,hue)
- create_letter(x,y,key)
- end
- #--------------------------------------------------------------------------
- # Create BG
- #--------------------------------------------------------------------------
- def create_bg(x,y)
- bg_info = Key_Menu::Show_HUD_Graphic
- if bg_info[0] ; self.bitmap = Cache.system(bg_info[1])
- else ; self.bitmap = Bitmap.new(26,26) ; end
- self.z = 201
- self.x = (x)
- self.y = (y)
- end
- #--------------------------------------------------------------------------
- # Create Icon
- #--------------------------------------------------------------------------
- def create_icon(x,y,icon_id,hue)
- @icon = Sprite.new
- @icon.bitmap = Cache.icon("IconSet", hue)
- rect = Rect.new(icon_id % 16 * 24, icon_id / 16 * 24, 24, 24)
- @icon.bitmap.blt(0, 0, @icon.bitmap, rect, 255)
- @icon.src_rect.set(rect.x, rect.y, 24, 24)
- @icon.z = (self.z)
- @icon.x = x+Key_Menu::Icon_Settings[0]
- @icon.y = y+Key_Menu::Icon_Settings[1]
- end
- #--------------------------------------------------------------------------
- # Create Letter
- #--------------------------------------------------------------------------
- def create_letter(x,y,key)
- @keys = key.to_s
- wids = (18 * @keys.size)
- @letter = Sprite.new
- @letter.bitmap = Bitmap.new(wids,18)
- @letter.bitmap.font.name = General::Fonts
- @letter.bitmap.font.size = Key_Menu::Text_Settings[2]
- @letter.bitmap.font.bold = Key_Menu::Text_Settings[3]
- @letter.bitmap.font.color = Key_Menu::Text_Settings[4]
- @letter.bitmap.font.out_color = Key_Menu::Text_Settings[5]
- @letter.bitmap.draw_text(0,0,wids,18,@keys)
- @letter.z = (self.z)
- @letter.x = x+Key_Menu::Text_Settings[0]
- @letter.y = y+Key_Menu::Text_Settings[1]
- @letter.opacity = Key_Menu::Text_Opacity[0]
- end
- #--------------------------------------------------------------------------
- # Dispose Litte Key HUD
- #--------------------------------------------------------------------------
- def dispose
- super
- @icon.dispose if @icon
- @letter.dispose if @letter
- end
- #--------------------------------------------------------------------------
- # Update Litte Key HUD
- #--------------------------------------------------------------------------
- def update
- super
- if Keys.press?(Keys::Key[@keys.to_sym])
- @letter.opacity = Key_Menu::Text_Opacity[1]
- end
- end
- end
- #===============================================================================
- class Spriteset_Map
- #===============================================================================
- #--------------------------------------------------------------------------
- # Initalize Litte Key HUD
- #--------------------------------------------------------------------------
- alias :init_KEY_HUD_SM :initialize
- alias :updt_KEY_HUD_SM :dispose
- alias :disp_KEY_HUD_SM :update
- #--------------------------------------------------------------------------
- # Initalize Litte Key HUD
- #--------------------------------------------------------------------------
- def initialize
- init_KEY_HUD_SM
- create_KEY_HUD
- end
- #--------------------------------------------------------------------------
- # Create Key HUD
- #--------------------------------------------------------------------------
- def create_KEY_HUD
- @key_HUD = []
- if Key_Menu::Pause_Key != :NONE && Key_Menu::Pause_Key_HUD[0]
- k = Key_Menu::Pause_Key_HUD
- @key_HUD << KM_HUD.new(Key_Menu::Pause_Key,k[1],k[2],k[3],k[4])
- end
- if Key_Menu::Menu_Key != :NONE && Key_Menu::Menu_Key_HUD[0]
- k = Key_Menu::Menu_Key_HUD
- @key_HUD << KM_HUD.new(Key_Menu::Menu_Key,k[1],k[2],k[3],k[4])
- end
- if Key_Menu::Items_Key != :NONE && Key_Menu::Items_Key_HUD[0]
- k = Key_Menu::Items_Key_HUD
- @key_HUD << KM_HUD.new(Key_Menu::Items_Key,k[1],k[2],k[3],k[4])
- end
- if Key_Menu::Skills_Key != :NONE && Key_Menu::Skills_Key_HUD[0]
- k = Key_Menu::Skills_Key_HUD
- @key_HUD << KM_HUD.new(Key_Menu::Skills_Key,k[1],k[2],k[3],k[4])
- end
- if Key_Menu::Equips_Key != :NONE && Key_Menu::Equips_Key_HUD[0]
- k = Key_Menu::Equips_Key_HUD
- @key_HUD << KM_HUD.new(Key_Menu::Equips_Key,k[1],k[2],k[3],k[4])
- end
- if Key_Menu::Status_Key != :NONE && Key_Menu::Status_Key_HUD[0]
- k = Key_Menu::Status_Key_HUD
- @key_HUD << KM_HUD.new(Key_Menu::Status_Key,k[1],k[2],k[3],k[4])
- end
- if Key_Menu::Save_Key != :NONE && Key_Menu::Save_Key_HUD[0]
- k = Key_Menu::Save_Key_HUD
- @key_HUD << KM_HUD.new(Key_Menu::Save_Key,k[1],k[2],k[3],k[4])
- end
- end
- #--------------------------------------------------------------------------
- # Dispose Litte Key HUD
- #--------------------------------------------------------------------------
- def dispose
- updt_KEY_HUD_SM
- if @key_HUD
- @key_HUD.each {|kh| kh.dispose }
- end
- end
- #--------------------------------------------------------------------------
- # Update Litte Key HUD
- #--------------------------------------------------------------------------
- def update
- disp_KEY_HUD_SM
- if @key_HUD
- @key_HUD.each {|kh| kh.update }
- end
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement