Project1

标题: 怎样去除坐标外围的框框 [打印本页]

作者: hgfor    时间: 2008-10-6 05:07
标题: 怎样去除坐标外围的框框


如下图所示的,把坐标外面的框框去了, 再把坐标图移动到最左上方.

  改来改去还是这样,哪位朋友帮我看看.




  代码在下面



  1. #-----------------------------------------------------------------------------
  2. # ■class map_XY
  3. #-----------------------------------------------------------------------------
  4. class Window_xy < Window_Base
  5.   
  6. def initialize
  7.    super(0, 0, 175, 100)
  8.    self.contents = Bitmap.new(width - 32, height - 22)
  9.    self.opacity = 255
  10.    self.back_opacity = 0
  11.    self.contents_opacity = 255      
  12.    self.visible = true
  13.    refresh
  14.    @x = $game_player.x
  15.    @y = $game_player.y
  16.    @id = $game_map.map_id
  17. end

  18. def refresh
  19.      @x = $game_player.x
  20.      @y = $game_player.y
  21.      @id = $game_map.map_id
  22.     self.contents.clear
  23.     a = "001"
  24.     bitmap=Bitmap.new("Graphics/Pictures/#{a}")
  25.     src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
  26.     self.contents.blt(0, 0, bitmap, src_rect)
  27.     $mapnames = load_data("Data/MapInfos.rxdata")
  28.     map_name = $mapnames[@id].name
  29.     self.contents.font.color = Color.new(255, 255, 255, 255)
  30.     self.contents.font.size = 16
  31.     self.contents.draw_text(0, 6, 105, 18, map_name,2)
  32.     self.contents.font.color = Color.new(255, 255, 255, 255)
  33.     self.contents.font.size = 16
  34.     self.contents.draw_text(0, 6, 105, 18, map_name,2)
  35.     self.contents.font.color = Color.new(255, 255, 255, 255)
  36.     self.contents.font.size = 16
  37.     self.contents.draw_text(0, 6, 105, 18, map_name,2)
  38.     self.contents.font.color = Color.new(255, 255, 255, 255)
  39.     self.contents.font.size = 12
  40.     self.contents.draw_text(10, 24, 120, 15, "X:")
  41.     self.contents.font.color = normal_color
  42.     self.contents.font.size = 12
  43.     self.contents.draw_text(0, 15, 45, 32, @x.to_s,2)
  44.     self.contents.font.color = Color.new(255, 255, 255, 255)
  45.     self.contents.font.size = 12
  46.     self.contents.draw_text(60, 15, 90, 32, "Y:")
  47.     self.contents.font.color = Color.new(255, 255, 255, 255)
  48.     self.contents.font.size = 12
  49.     self.contents.draw_text(0, 15, 95, 32, @y.to_s,2)
  50.   end
  51.   
  52. def judge
  53.    return true if @x != $game_player.x
  54.    return true if @y != $game_player.y
  55.    return true if @id != $game_map.map_id
  56.    return false
  57. end
  58. end

  59. class Scene_Map
  60. alias xy_66rpg_main main
  61. def main
  62.    @xy_window = Window_xy.new
  63.    @xy_window.x = 1
  64.    @xy_window.y = 1
  65.    xy_66rpg_main
  66.    @xy_window.dispose
  67. end
  68. alias xy_66rpg_update update
  69. def update
  70.    xy_66rpg_update
  71.      
  72.      @xy_window.visible = false
  73.      @xy_window.refresh if @xy_window.judge
  74.    else
  75.      @xy_window.visible = true

  76. end
  77. 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