Project1
标题:
怎样去除坐标外围的框框
[打印本页]
作者:
hgfor
时间:
2008-10-6 05:07
标题:
怎样去除坐标外围的框框
如下图所示的,把坐标外面的框框去了, 再把坐标图移动到最左上方.
改来改去还是这样,哪位朋友帮我看看.
代码在下面
#-----------------------------------------------------------------------------
# ■class map_XY
#-----------------------------------------------------------------------------
class Window_xy < Window_Base
def initialize
super(0, 0, 175, 100)
self.contents = Bitmap.new(width - 32, height - 22)
self.opacity = 255
self.back_opacity = 0
self.contents_opacity = 255
self.visible = true
refresh
@x = $game_player.x
@y = $game_player.y
@id = $game_map.map_id
end
def refresh
@x = $game_player.x
@y = $game_player.y
@id = $game_map.map_id
self.contents.clear
a = "001"
bitmap=Bitmap.new("Graphics/Pictures/#{a}")
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
self.contents.blt(0, 0, bitmap, src_rect)
$mapnames = load_data("Data/MapInfos.rxdata")
map_name = $mapnames[@id].name
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 16
self.contents.draw_text(0, 6, 105, 18, map_name,2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 16
self.contents.draw_text(0, 6, 105, 18, map_name,2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 16
self.contents.draw_text(0, 6, 105, 18, map_name,2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 12
self.contents.draw_text(10, 24, 120, 15, "X:")
self.contents.font.color = normal_color
self.contents.font.size = 12
self.contents.draw_text(0, 15, 45, 32, @x.to_s,2)
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 12
self.contents.draw_text(60, 15, 90, 32, "Y:")
self.contents.font.color = Color.new(255, 255, 255, 255)
self.contents.font.size = 12
self.contents.draw_text(0, 15, 95, 32, @y.to_s,2)
end
def judge
return true if @x != $game_player.x
return true if @y != $game_player.y
return true if @id != $game_map.map_id
return false
end
end
class Scene_Map
alias xy_66rpg_main main
def main
@xy_window = Window_xy.new
@xy_window.x = 1
@xy_window.y = 1
xy_66rpg_main
@xy_window.dispose
end
alias xy_66rpg_update update
def update
xy_66rpg_update
@xy_window.visible = false
@xy_window.refresh if @xy_window.judge
else
@xy_window.visible = true
end
end
复制代码
[LINE]1,#dddddd[/LINE]
此贴于 2008-10-7 13:25:06 被版主darkten提醒,请楼主看到后对本贴做出回应。
[LINE]1,#dddddd[/LINE]
本贴由论坛斑竹darkten结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^
作者:
闪电
时间:
2008-10-6 05:09
self.opacity = 255改成self.opacity = 0
框就没了
作者:
hgfor
时间:
2008-10-6 05:14
这样框是变成透明的,我想把它去除掉该怎么做?
而且要把坐标图显示在最左上方.
以下引用
闪电于2008-10-5 21:09:34
的发言:
self.opacity = 255改成self.opacity = 0
框就没了
作者:
hgfor
时间:
2008-10-6 05:43
哪位高手帮忙看看啊
作者:
hgfor
时间:
2008-10-6 19:26
怎么没人知道吗? 帮帮忙.
作者:
塑望
时间:
2008-10-6 19:35
效果如上
把第9行替换成self.opacity = 0
坐标是
@xy_window.x = 100
@xy_window.y = 100
自己修改 [LINE]1,#dddddd[/LINE]
系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~
作者:
hgfor
时间:
2008-10-6 21:04
按照楼上朋友的方法,现在可以了, 但是下图所示的图标怎么删除?
作者:
redant
时间:
2008-10-7 00:35
def initialize
super(0, 0, 656, 496)
self.contents = Bitmap.new(width , height)
self.opacity = 0
self.back_opacity = 0
self.contents_opacity = 255
self.visible = true
是否解决?
解决请认可 一半 吧{/hx}
其实是把矩形框 扩大到全屏而已小三角还是有的不过在 屏幕外……
[LINE]1,#dddddd[/LINE]
系统信息:本贴获得楼主认可,66RPG感谢您的热情解答~
作者:
hgfor
时间:
2009-6-12 08:00
问题已经解决,方法如下:
super(0, 0, 680, 560)
self.opacity = 0
设置坐标
@xy_window.x = - 15
@xy_window.y = - 15
谢谢楼上的各位朋友.
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1