Project1
标题:
时间窗口透明和改颜色
[打印本页]
作者:
547895913
时间:
2012-8-18 11:14
标题:
时间窗口透明和改颜色
怎么改透明和更换颜色啊?
脚本下面
[pre lang="ruby" line="1"]#==============================================================================
# 本脚本来自
www.66RPG.com
,使用和转载请保留此信息
#==============================================================================
#==============================================================================
# ■ Window_PlayTime
#------------------------------------------------------------------------------
# 菜单画面显示游戏时间的窗口。
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 128 )
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, -4, 120, 32, "时间")
@total_sec = Graphics.frame_count / Graphics.frame_rate
t = Time.now
$game_variables[204] = t.wday # 星期
$game_variables[208] = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"][$game_variables[204]]
text = sprintf("%02d:%02d:%02d", t.hour, t.min, t.sec)
text2 = sprintf("%02d.%02d.%02d", t.year, t.month, t.day)
text3 = sprintf($game_variables[208])
self.contents.font.color = normal_color
self.contents.draw_text(4, 24, 110, 32, text2, 2)
self.contents.draw_text(-25, 48, 110, 32, text3, 2)
self.contents.draw_text(-3, 72, 110, 32, text, 2)
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
#==============================================================================
# 本脚本来自
www.66RPG.com
,使用和转载请保留此信息
#==============================================================================[/pre]
‘‘──547895913于2012-8-18 11:16补充以下内容:
我的时间窗口已经摆在地图上了 求透明指教 谢谢
’’
作者:
hys111111
时间:
2012-8-18 11:48
在30行self.contents = Bitmap.new(width - 32, height - 32)
下面插入:
if $scene.is_a?(Scene_Map)
self.opacity = 不透明度
self.back_opacity = 不透明度
end
复制代码
作者:
547895913
时间:
2012-8-18 11:52
唔该!谢谢!!
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X5.0