查看: 2185|回复: 3

[已经解决] 求界面显示变量。要不与对话框冲突的。

[复制链接]
梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

发表于 2015-12-1 22:08:21 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
我要在右下角显示3个变量。
用了主站的那个右下角显示金钱的脚本后。虽然右下角是能显示变量了。
可是问题是对话框的“是”“否”选不了了

评分

参与人数 1星屑 +35 收起 理由
RyanBern + 35 手动认可奖励

查看全部评分

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2015-12-1 22:43:10 | 显示全部楼层
是需要添加窗口吗?
回复

使用道具 举报

梦石
0
星屑
12161
在线时间
4435 小时
注册时间
2014-4-11
回帖
5616

开拓者

 楼主| 发表于 2015-12-1 22:45:23 | 显示全部楼层
汪汪 发表于 2015-12-1 22:43
是需要添加窗口吗?

有没有窗口都无所谓。只要能看到变量就行了。我把船的攻击防御HP设置到了变量里。要把这些变量显示到外面能直接看到

点评

 ̄_ ̄||原来这里是xp啊........看错了.....  发表于 2015-12-2 11:34
回复

使用道具 举报

梦石
0
星屑
9716
在线时间
2775 小时
注册时间
2008-9-5
回帖
3458

开拓者短篇八RM组冠军短篇九导演组亚军白银编剧

发表于 2015-12-2 16:50:58 | 显示全部楼层
本帖最后由 cinderelmini 于 2015-12-2 16:55 编辑

直接码的脚本,不知道是不是有问题,使用了变量1,2,3号(自己可以在脚本里的【refresh】里面改),
1号开关打开的时候窗口显示,否则消失(开关编号在脚本里的【update】里面改)。唔……大概就这样吧……
Main前Insert

  1. class Window_Values < Window_Base
  2.   def initialize
  3.     super(640 - window_width, 480 - window_height, window_width, window_height)
  4.     self.contents = Bitmap.new(width - 32, height - 32)
  5.     self.back_opacity = 180
  6.     self.visible = $game_switches[1]
  7.     refresh
  8.   end
  9.   
  10.   def refresh
  11.     self.contents.clear
  12.     @value_a = $game_variables[1]
  13.     @value_b = $game_variables[2]
  14.     @value_c = $game_variables[3]
  15.     self.contents.draw_text(0, 32 * 0, window_width - 32, 32, "变量文字1:")
  16.     self.contents.draw_text(0, 32 * 0, window_width - 32, 32, @value_a.to_s, 2)
  17.     self.contents.draw_text(0, 32 * 1, window_width - 32, 32, "变量文字2:")
  18.     self.contents.draw_text(0, 32 * 1, window_width - 32, 32, @value_b.to_s, 2)
  19.     self.contents.draw_text(0, 32 * 2, window_width - 32, 32, "变量文字3:")
  20.     self.contents.draw_text(0, 32 * 2, window_width - 32, 32, @value_c.to_s, 2)
  21.   end
  22.   
  23.   def need_refresh?
  24.     return @value_a != $game_variables[1] ||
  25.     @value_b != $game_variables[2] ||
  26.     @value_c != $game_variables[3]
  27.   end
  28.   
  29.   def update
  30.     super
  31.     self.visible = $game_switches[1] if self.visible != $game_switches[1]
  32.     refresh if need_refresh?
  33.   end
  34.   
  35.   def window_width
  36.     return 144 + 32
  37.   end
  38.   
  39.   def window_height
  40.     return 32 * 3 + 32
  41.   end
  42. end

  43. class Scene_Map
  44.   alias sn_151202_main main
  45.   def main
  46.     @values_window = Window_Values.new
  47.     sn_151202_main
  48.     @values_window.dispose
  49.   end
  50.   
  51.   alias sn_151202_update update
  52.   def update
  53.     @values_window.update
  54.     sn_151202_update
  55.   end
  56. end
复制代码

点评

感谢大神,目前还没发现问题。  发表于 2015-12-2 19:09

评分

参与人数 1梦石 +1 收起 理由
RyanBern + 1 认可答案

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部