Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Coordinate Window on the map
#1
This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


This script just makes a little box in the upper left corner showing the players current coordinates on the map. I don't know what it might be useful for, but I was bored and felt like playing around with some scripting... this was the result :icon_wink:

Code:
#==============================================================================
# ** Coordinate Display Window
#------------------------------------------------------------------------------
# Slanter
# Version 1
# 2006-08-29
#------------------------------------------------------------------------------
# * Instructions: Press F8 while on the map to toggle a box at 0,0 with the
#                 player's current coordinates.
#==============================================================================

#--------------------------------------------------------------------------
# * SDK Log Script
#--------------------------------------------------------------------------
SDK.log('CoordWindow', 'Slanter', 1, '2006-08-29')

#--------------------------------------------------------------------------
# Begin SDK Enabled Check
#--------------------------------------------------------------------------
if SDK.state('CoordWindow') == true
    
#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Alias Command: Update
#--------------------------------------------------------------------------
  alias slanter_coordwin_scnmap_update update
#--------------------------------------------------------------------------
# * Update: Add F8 trigger
#--------------------------------------------------------------------------
  def update
    if $DEBUG and Input.trigger?(Input::F8)
      if @coord_win == true
        @coord_win = false
        @coordinate_window.dispose
      else
        @coord_win = true
        coordinate_window
      end
    end
    if @coord_win == true
      @coordinate_window.dispose
      coordinate_window
    end  
    slanter_coordwin_scnmap_update
  end
#--------------------------------------------------------------------------
# * Coordinate_Window: Create Window_Coordinate
#--------------------------------------------------------------------------
  def coordinate_window
    @coordinate_window = Window_Coordinate.new
    @coordinate_window.x=0
    @coordinate_window.y=0
    @coordinate_window.height=96
    @coordinate_window.width=100
    @coordinate_window.back_opacity=160
  end
end

#==============================================================================
# ** Window_Coordinate
#==============================================================================
class Window_Coordinate < Window_Base
  def initialize
    super(0, 0, 100,96)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    self.contents.font.color = text_color(0)
    self.contents.draw_text(0, 0, 100, 32, "X = " + $game_player.x.to_s)
    self.contents.draw_text(0, 32, 100, 32, "Y = " + $game_player.y.to_s)
  end
end

#--------------------------------------------------------------------------
# End SDK Enabled Test
#--------------------------------------------------------------------------
end

Script without SDK dependancy
Code:
#==============================================================================
# ** Coordinate Display Window
#------------------------------------------------------------------------------
# Slanter
# Version 1
# 2006-08-29
#------------------------------------------------------------------------------
# * Instructions: Press F8 while on the map to toggle a box at 0,0 with the
#                 player's current coordinates.
#==============================================================================
    
#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Alias Command: Update
#--------------------------------------------------------------------------
  alias slanter_coordwin_scnmap_update update
#--------------------------------------------------------------------------
# * Update: Add F8 trigger
#--------------------------------------------------------------------------
  def update
    if $DEBUG and Input.trigger?(Input::F8)
      if @coord_win == true
        @coord_win = false
        @coordinate_window.dispose
      else
        @coord_win = true
        coordinate_window
      end
    end
    if @coord_win == true
      @coordinate_window.dispose
      coordinate_window
    end  
    slanter_coordwin_scnmap_update
  end
#--------------------------------------------------------------------------
# * Coordinate_Window: Create Window_Coordinate
#--------------------------------------------------------------------------
  def coordinate_window
    @coordinate_window = Window_Coordinate.new
    @coordinate_window.x=0
    @coordinate_window.y=0
    @coordinate_window.height=96
    @coordinate_window.width=100
    @coordinate_window.back_opacity=160
  end
end

#==============================================================================
# ** Window_Coordinate
#==============================================================================
class Window_Coordinate < Window_Base
  def initialize
    super(0, 0, 100,96)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = "Tahoma"
    self.contents.font.size = 22
    self.contents.font.color = text_color(0)
    self.contents.draw_text(0, 0, 100, 32, "X = " + $game_player.x.to_s)
    self.contents.draw_text(0, 32, 100, 32, "Y = " + $game_player.y.to_s)
  end
end
}


Possibly Related Threads…
Thread Author Replies Views Last Post
  Display a gold window on the map Chronic_NG 0 2,734 12-04-2006, 01:00 PM
Last Post: Chronic_NG
  Description Window Caldaron 0 2,521 10-09-2006, 01:00 PM
Last Post: Caldaron
  Location Window Eccid 0 2,077 09-11-2005, 01:00 PM
Last Post: Eccid
  Different Gold Window Sheol 0 2,178 09-01-2005, 01:00 PM
Last Post: Sheol
  New Command Window SephirothSpawn 0 1,910 07-15-2005, 01:00 PM
Last Post: SephirothSpawn
  Custom message window dragonslayer 0 2,123 03-25-2005, 01:00 PM
Last Post: dragonslayer
  Floating Window gatene 0 1,979 03-22-2005, 01:00 PM
Last Post: gatene



Users browsing this thread: