Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Map Loction HUD
hunter x
post Jun 16 2008, 05:06 AM
Post #1



Group Icon

Group: Member
Posts: 3
Type: Artist
RM Skill: Beginner




Hi evry body.....

this my first script ihave made it so simple it show map loction , you need these pictur for the Hud:


Image:


Demo:
Idon't thinj it need Demo rolleyes.gif .

Script:

post it above main and change name to Map_Loction.
[Show/Hide] The Script
CODE
#==============================================================================
# Map_Loction
#------------------------------------------------------------------------------
# simple map loction ,iam typr note if you want to changr happy.gif
# by Hunter x
# v. 1.0
# http://www.rpgrevolution.com/
#==============================================================================

module LSRS
  
  
  module ScriptConfig_001
    
    # time for the hud hidden
    Timer = 150
    
    # pictur loction must be on ( Windowskin )
    BackGroundImage = "Chip_Location"
    
    # Position(3=down 9=up)
    Position = 9
    
    # Opacity of the Hud
    Opacity = 155
    
    # Position of the Font (0:Left 1:Midlle 2:right)
    LabelPosition = 1
    
    # Font Type and Color
    LabelFont = Font.new(["MS UI Gothic", "Tahoma", "Tahoma"])
    LabelFont.color = Color.new(0, 0, 0)
    #LabelFont.size = 22      #Size of the font
    #LabelFont.bold = false   # (true : bold, false :Normal)
    #LabelFont.italic = false # (true : italic, false :Normal)
  end
end

# Dont touch happy.gif
class LSRS::Sprite_Location < Sprite
  include LSRS::ScriptConfig_001
  @@cache = {}
  
  
  def initialize(text)
    super()
    RPG::Cache.windowskin(BackGroundImage).font = LabelFont
    self.z = 9996
    self.opacity = 0
    @count = 0
    @text = text
    refresh
    set_align
  end
  
  
  def update
    if @text != $game_map.map_name
      @text = $game_map.map_name
      refresh
    end
    if $game_system.map_interpreter.running?
      
      self.opacity -= 24
      
      @count = 0
    elsif @count.zero?
      self.opacity -= 12
    elsif self.opacity < Opacity
      self.opacity = [self.opacity += 12, Opacity].min
    else
      @count -= 1
    end
  end
  
  
  def refresh
    if @text.empty?
      
      self.visible = false
      return
    end
    if @@cache[@text]
      self.bitmap = @@cache[@text]
    else
      self.bitmap = RPG::Cache.windowskin(BackGroundImage).dup
      
      self.bitmap.draw_text(self.bitmap.rect, @text, LabelPosition)
      @@cache[@text] = self.bitmap
    end
    self.visible = true
    @count = Timer
  end
  
  
  def set_align
    self.x = case Position % 3
      when 1 then 0
      when 2 then 320 - self.width / 2
      else 640 - self.width
    end
    self.y = case Position
      when 1 .. 3 then 480 - self.height
      when 4 .. 6 then 240 - self.height / 2
      else 0
    end
  end
  
  
  def height
    self.bitmap ? self.bitmap.rect.height : 0
  end
  
  
  def width
    self.bitmap ? self.bitmap.rect.width : 0
  end
end


class Game_Map
  @@mapinfo = load_data("Data/MapInfos.rxdata")
  
  
  def map_name(id = @map_id)
    @@mapinfo[id].name.sub(/@.*/, "")
  end
end


class Scene_Map
  alias :main_lsrs1 :main
  alias :update_lsrs1 :update
  

  def main
    @location_sprite = LSRS::Sprite_Location.new($game_map.map_name)
    main_lsrs1
    @location_sprite.dispose
  end
  

  def update
    update_lsrs1
    @location_sprite.update
  end
end


Note:Iam Arbic one so ican't type English very well.

Hopw it usefull. laugh.gif
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
blakerrdurr
post Aug 15 2010, 09:53 AM
Post #2


Level 1
Group Icon

Group: Member
Posts: 5
Type: Developer
RM Skill: Skilled




thanks! smile.gif it works great.
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- hunter x   Map Loction HUD   Jun 16 2008, 05:06 AM
- - KDawg08   I'm new to this stuff but I've been downlo...   Jun 16 2008, 11:06 PM
- - Josuec   Thank you very much, it works . !   Aug 9 2009, 05:31 PM
- - Gary The Duck   Nice, thank you!   Aug 29 2009, 03:21 AM
|- - cupski   Great! Thank!   Jan 24 2010, 12:29 AM
- - Seitei Son Goku   A pretty useful script! Indeed, a life saver f...   Apr 5 2010, 10:40 PM
|- - ragnaroc444   QUOTE (Seitei Son Goku @ Apr 6 2010, 04:4...   Apr 9 2010, 03:44 AM
- - Crazygi   Wow this is great and works perfectly. However I w...   Apr 14 2010, 02:27 PM
- - LegACy   @ragnaroc444 yes you can, all you have to do i...   Apr 14 2010, 02:47 PM
|- - Crazygi   QUOTE (LegACy @ Apr 14 2010, 11:47 PM) lo...   Apr 14 2010, 02:51 PM
- - dsoulja85   SWEET!!, this is exactly what i was lookin...   Apr 21 2010, 01:46 PM
- - Mataris   Sweet this is perfect only thing i would like is a...   Apr 24 2010, 11:15 PM
- - Locke   Oh boy! This is better and it works too. I...   Apr 30 2010, 11:34 PM
- - Crossknive   How come when I change the map I'm in it goes ...   May 3 2010, 09:38 AM
- - Scriptless   If you want the map HUD to look like a default win...   May 3 2010, 12:01 PM
- - YoshidudeEx   Thank you. I been looking almost everywhere for th...   Jul 10 2010, 05:37 PM
- - drakiyth   This is a nice script and all but you need to make...   Aug 12 2010, 03:54 PM
- - Night_Runner   @> drakiyth: Give edit this a go: [Show/Hide] H...   Aug 13 2010, 12:23 AM
- - blakerrdurr   I'm having a similar problem but the opposite ...   Aug 14 2010, 10:53 AM
- - Night_Runner   Yup, completely possible Just needs a bit of edit...   Aug 14 2010, 08:34 PM
- - blakerrdurr   thanks! it works great.   Aug 15 2010, 09:53 AM
- - oekoeloe   Hey, How do I make it use the default skin of RPG...   Aug 27 2010, 09:04 AM
- - andry5ury4   Is this for XP???? are someone can change it into ...   Feb 18 2012, 02:15 AM
- - Night_Runner   Since you said please CODE#=====================...   Feb 18 2012, 04:39 AM


Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th June 2013 - 12:51 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker