Coordinate Displayer
Authors: game_guy
Version: 1.1
Type: Coordinate Displayer
Key Term: Environment Add-on
IntroductionDisplays the X and Y coordinates on map.
Features
- Displays X and Y coordinates on map.
- Select Transparency of Window
- Select Location of Window
Screenshots(http://i307.photobucket.com/albums/nn318/bahumat27/coordinate.png)
DemoNo Demo
ScriptPlace above Blizz's Scripts and Below SDK if you use it and below the default scripts.
#==============================================================================#
# Game Guy's Coordinate Displayer #
#==============================================================================#
=begin
This will show a window on the map displaying X and Y coordinates.
Customization
module
Location = "Upper Right Corner" "Lower Left Corner" "Upper Left Corner" or "Lower Right Corner"
Transparent = "Non Transparent" "Semi-Transparent" "Transparent"
UsePicture = true or false if set to true and transparent = "Non Transparent" it will automatically set it to "Transparent"
PictureName = "picture name here" must be in quotes
end
=end
LOCATION = "Upper Right Corner"
TRANSPARENT = "Semi-Transparent"
USEPICTURE = false #NOT WORKING YET SO GO AHEAD AND SET IT TO TRUE BUT STILL WONT WORK
PICTURENAME = "picture name here"
class Window_Coordinate < Window_Base
def initialize
super(0, 0, 160, 96)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120, 32, "X: " + $playerx.to_s)
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, "Y: " + $playery.to_s)
end
def update
super
$playerx = $game_player.x * 32
$playery = $game_player.y * 32
refresh
end
end
class Scene_Map
alias add_coordinate_window_later main
def main
if $DEBUG
@coordinate = Window_Coordinate.new
if LOCATION == "Upper Right Corner"
@coordinate.x = 480
elsif LOCATION == "Upper Left Corner"
@coordinate.x = 0
elsif LOCATION == "Lower Right Corner"
@coordinate.x = 480
@coordinate.y = 374
else
@coordinate.y = 374
end
if USEPICTURE == true
if TRANSPARENT == "Non Transparent"
@coordinate.opacity = 0
@coordinate.back_opacity = 0
end
end
if TRANSPARENT == "Transparent"
@coordinate.opacity = 0
@coordinate.back_opacity = 0
elsif TRANSPARENT == "Semi-Transparent"
@coordinate.opacity = 155
@coordinate.back_opacity = 155
else
@coordinate.opacity = 255
@coordinate.back_opacity = 255
end
end
@spriteset = Spriteset_Map.new
@message_window = Window_Message.new
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@spriteset.dispose
@coordinate.dispose
@message_window.dispose
if $scene.is_a?(Scene_Title)
Graphics.transition
Graphics.freeze
end
Graphics.freeze
end
alias update_coordinate_window_later update
def update
if $DEBUG
if @coordinate.active
update_coordinate
end
end
update_coordinate_window_later
end
def update_coordinate
if $DEBUG
if Input.trigger?(Input::A)
if @coordinate.visible
@coordinate.visible = false
else
@coordinate.visible = true
end
end
@coordinate.update if @coordinate.visible && @coordinate.active
end
end
end
InstructionsJust requires some customization. Which is in the script.
CompatibilityShould be compatible with everything. Its just a little bit of modding from the defual scripts. Place below SDK though.
Credits and Thanks
Author's NotesBe sure to credits!!! :)
THIS IS MOSTLY FOR DEBUGGING IN CASE YOU NEED SOME X AND Y COORDINATES.
Ironically, I see potential in this NOT for debugging. Sure, I can always just go into debug and help me find some secret items or what have you in the map, but simply going into the editor and checking those tiles out are easier and more of a convenience for me.
Please add more customization with this script...User friendly customization I mean. :P Like maybe have the use of pictures or an HUD for something like this instead of the windowskin (Perhaps a choice between the two in a config section? ), and if you haven't already, set a Debug flag with this in a config...
I've added teh $DEBUG already and I am adding the picture customization.
This is very simple and neat. Good job, G_G. *powers up*
I very good way to use this is as a treasure finder as you can collect maps and use a tool to get treasure with the displayer.
Updated it. Now instead of display the actual x and y it displays the pixels. anyone can figure out the x and y in the editor but the pixels require to multiply x by 32
x = any number