赞 | 1 |
VIP | 171 |
好人卡 | 21 |
积分 | 4 |
经验 | 59678 |
最后登录 | 2024-7-30 |
在线时间 | 1292 小时 |
- 梦石
- 0
- 星屑
- 362
- 在线时间
- 1292 小时
- 注册时间
- 2013-1-12
- 帖子
- 3590
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 76213585 于 2013-9-23 22:32 编辑
In order to make window dispose more nature is to make is fade out.
==========================================
First, add def pre_terminate Into the script anywhere.(out side of any other method)
Then add a method "fade" and"dispose"
It should look like this.- def pre_terminate
- fade
- dispose
- end
复制代码 Then below it we add def fade and def dispose
In dispose, you dispose all the window, kind of obvious what to do.....
So we just skip the def dispose
And go to def fade
We are going to use the loop do method to help us
Let's use the Menu Scene as our example...
This is how it should look like....
If XXX is not more than 1, it exit the loop do(using"break") if it's more than 1, it does"........"part over and over- def fade
- loop do
- if XXX > 1
- ..........................
- else
- break
- end
- end
复制代码 The xxx should be whatever the window you have in your scene like @status_window.opacity
So let's switch to this.....- def fade
- loop do
- if @status_window.opacity > 1
- ............
- else
- break
- end
- end
复制代码 OK, we will do the ......... part over and over again until @status_window.opacity if more than one.
So we can add @status_window.opacity -= 1 as the .............
Which will fade out the window's opacity by 1 and 1
Also we could add other window's as well!
If you're sure that all window's opacity will be the same (Should be......)
you can just add them toghter... like under @status_window.opacity -= 1 you put @gold_window.opacity -= 1 which will fade out both of them!
So our finishing thing should look like this: (for Meun Scene)- def pre_terminate
- fade
- dispose
- end
- def fade
- loop do
- # a = @status_window.opacity
- if @status_window.opacity > 1
- @gold_window.opacity -= 1
- @command_window.opacity -= 1
- @status_window.opacity -= 1
- @variable_window.opacity -= 1
- else
- break
- end
- end
- end
- def dispose
- @ActorPortrait.dispose
- @gold_window.dispose
- @command_window.dispose
- @status_window.dispose
- @variable_window.dispose
- end
复制代码 For the other scene, it's exactly the same as well! |
|