标题: 求事件运行刷新的调用函数名…… [打印本页] 作者: yeyunfeiyuyue 时间: 2011-10-26 06:22 标题: 求事件运行刷新的调用函数名…… else
a = Window_Base.new(80,304,480,160)
a.contents = Bitmap.new(a.width-32, a.height-32)
a.contents.draw_text(0,0,240,32,"啊哈哈哈哈哈")
a.opacity = 160
@wait_count =100
( for i in 1..30
Graphics.update
{event运行的刷新}
end )
for i in 0..10
a.opacity -= 30
a.contents_opacity -= 30
Graphics.update
end
a.dispose
end
那啥⋯⋯lz你先去学习下面向对象的编程⋯⋯ruby的方法调用一点都不诡异,诡异的是RGSS,是RMXP自带的代码⋯⋯(写的太垃圾了)作者: yeyunfeiyuyue 时间: 2011-10-27 05:31
# 更新地圖事件
for event in @events.values
event.update
end
# 更新公共事件
for common_event in @common_events.values
common_event.update
end
else
a = Window_Base.new(80,304,480,160)
a.contents = Bitmap.new(a.width-32, a.height-32)
a.contents.draw_text(0,0,240,32,"啊哈哈哈哈哈")
a.opacity = 160
@wait_count =100
( for i in 1..30
Graphics.update
{event运行的刷新}
end )
for i in 0..10
a.opacity -= 30
a.contents_opacity -= 30
Graphics.update
end
a.dispose
end
#改为(红色改蓝色)
else
pop
end
#同类(class)中 新增
def pop
@a = Window_Base.new(80,304,480,160)
@a.contents = Bitmap.new(a.width-32, a.height-32)
@a.contents.draw_text(0,0,240,32,"啊哈哈哈哈哈")
@a.opacity = 160
@wait_pop = 30
@wait_count =100
end
def pop_update
@wait_pop -= 1
if @wait_pop < 0
@a.opacity -= 30
@a.contents_opacity -= 30
end
pop_dispose if @a.opacity == 0
end
def pop_dispose
@a.dispose
@a = nil
end
def update
pop_update if @a != nil #<=在同类的update里加入这1行
end # 如果你的类里没有update
# 那需要在调用到这个类的变量的那个类的update里写上:
# 调用到这个类的变量.update
# 上面最后2句我说不清楚你自己理解