@Ericmor: Good try, but you're not quite there. (Except the first)
Here's an 'enhanced' script while we wait for Tsuno to make a proper one. (Yes I am lazy)
You can change the alignment of the window rather easily here. Script:
class Floating_Location < Window_Base
#--------------------------------------------------------------------------
# The position of the window
# [x,y]
#
# x = 1 => left
# x = 2 => center
# x = 3 => right
#
# y = 1 => top
# y = 2 => center
# y = 3 => bottom
#--------------------------------------------------------------------------
POSITION = [2,3]
def initialize
@map_name = get_name
if @map_name == ""
@size = [32,32]
else
@size = Win_Size.new(@map_name)
end
width = @size[0]
height = @size[1]
case POSITION[0]
when 1
ox = 0
when 2
ox = 640-(width+32)
ox = ox/2
when 3
ox = 640-(width+32)
end
case POSITION[1]
when 1
oy = 0
when 2
oy = 480-(height+32)
oy = oy/2
when 3
oy = 480-(height+32)
end
super(ox, oy, width+32, height+32)
self.contents = Bitmap.new(width, height)
if @map_name == ""
self.visible = false
else
self.opacity = 240
self.back_opacity = 240
self.contents_opacity = 240
end
@frame_wait = Graphics.frame_count + 60
refresh
end
def refresh
self.contents.font.color = Color.new(217,87,0,255)
self.contents.draw_text(0, 0, @size[0], @size[1], @map_name)
end
def update
if @map_name == ""
self.dispose
return
end
if get_name != @map_name
self.dispose
return
end
if @frame_wait <= Graphics.frame_count
if self.opacity > 0
self.opacity -= 20
self.back_opacity -= 20
self.contents_opacity -= 20
else
self.dispose
return
end
end
end
def get_name
data = load_data("Data/MapInfos.rxdata")
data[$game_map.map_id].name
end
end
class Win_Size < Window_Base
def initialize(text)
super(0, 0, 640, 480)
self.contents = Bitmap.new(640 - 32, 480 - 32)
@w = contents.text_size(text).width
@h = contents.text_size(text).height
self.dispose
end
def [](value)
if value == 0
return @w
else
return @h
end
end
end
class Scene_Map
alias :main_orig :main
alias :update_orig :update
alias :transfer_player_orig :transfer_player
def main
@floating_location.dispose unless @floating_location.nil?
@floating_location = Floating_Location.new
main_orig
@floating_location.dispose unless (@floating_location.disposed? or
@floating_location.nil?)
end
def update
@floating_location.update unless (@floating_location.disposed? or
@floating_location.nil?)
update_orig
end
def transfer_player
transfer_player_orig
@floating_location.dispose unless (@floating_location.disposed? or
@floating_location.nil?)
@floating_location = Floating_Location.new
end
end
Just change the values in 'POSITION = [2,3]'
Change the 2 and 3 to whatever value you feel like.
For the first value:
1 => left
2 => center
3 => right
For the second value
1 => top
2 => center
3 => bottom
So in this case the window will be placed in the center on the bottom of the screen.
I know this is rather sucky, but then again... I only used 10 minutes on this.