Jump to content

Recommended Posts

Animated windows

-Tsukihime

 

animated_windows1.JPG

 

This script provides animation properties that allow you to easily design animated windows. It adds additional methods and attributes to the Window_Base class.

 

Using this script, window animation becomes trivial.

 

Features

 

Window related features

  • reposition window
  • resize window
  • slide window
  • fade window (adjust all opacities uniformly)

Window content related features

 

...

 

Download

 

Script: http://db.tt/WDmKEmxK

 

Usage

 

In various Window methods, you can set the following attributes:

 

@new_x
@new_y
@new_width
@new_height
@new_opacity
@slide_speed
@fade_speed

 

The windows will automatically update themselves according to the new values.

This allows you to define the following animations:

 

Opening animations

 

This defines how windows should appear on the screen. It can be defined anywhere, but typically will be defined in `opening_animation` and `open` methods.

 

Closing animations

 

This defines how windows should disappear from the screen.

It is typically defined in `closing_animation` and `close` methods.

 

Example

 

I quickly converted the default menu to a sliding menu window by adding a couple lines to the initialize methods. You can see it by making a new project, copying the animated window script, and then inserting this script after it.

 

Here are two examples of the default menu, with a couple extra animation properties added

 

1: http://db.tt/DbMLj0ry - window slides in from the outside, slides out outwards

2: http://db.tt/XOmoUsl6 - window slides in from the outside, then crosses across the screen

3: http://db.tt/ZVOXCeK4 - let's throw in some fade outs.

 

By specifying the new_x and new_y values and re-positioning the window outside of the screen, you can easily create a slide-in menu. I also specified the slide speed for the window because some windows have to slide a longer distance.

 

Edited by Tsukihime

Share this post


Link to post
Share on other sites
However, sliding out is another issue because of how the windows are disposed and scenes terminated...will have to look into it some more.

 

Couldn't you slide on pre_terminate and force a wait until the sliding is done before calling terminate?

Share this post


Link to post
Share on other sites

Couldn't you slide on pre_terminate and force a wait until the sliding is done before calling terminate?

 

Yes, that sounds like a reasonable way to do it.

Only issue is how to actually wait until all window animations have been completed.

 

Rather than wait, I would be calling a special pre-terminate update that's meant for these animations, rather than possibly having users give input.

 

pre-terminate will be rewritten so that it will process these window disposal animations, and will be inherited by all other scenes. It shouldn't affect other scenes if they're not using animations.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

5 months later I come back to this script and fill out the pre-terminate function.

Here is an example of how the default menu slides in and slides out, with two simple additions:

 

1 - defining how the window enters (opening animation)

2 - defining how the window exits (closing animation)

 

The opening animation is where you define how the window enters the screen.

The closing animation is where you define how the window exits the screen

 

Here are two examples of the default menu, with a couple extra animation properties added

 

1: http://db.tt/DbMLj0ry - window slides in from the outside, slides out outwards

2: http://db.tt/XOmoUsl6 - window slides in from the outside, then crosses across the screen

Edited by Tsukihime

Share this post


Link to post
Share on other sites

I'm going to be adding a new variable called "anim_type"

This allows you to use pre-defined animations.

 

Think of the transitions in powerpoint, where you could choose a bunch of pre-defined styles.

An animation is currently defined by three things

 

1. start position

2. end position

3. animation type

 

Currently I group "fade" and "slide" together because there are only two, but later there will be built in support for things like "spiral", though you may have to make a method call to specify additional attributes like radius and other math related properties.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

I have a glitch with YEA - Ace Menu Engine. When I set the command window to right align it starts at the right and slides across to the left, it should slide on screen to the right same with the status window.

Share this post


Link to post
Share on other sites

Is it possible that yanfly is initializing the window AFTER creating it? Because if you re-position the window after it has been initialized then things will look weird.

 

This isn't a plug and play thing. You actually need to go and manually create your own window animations.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Is it possible that yanfly is initializing the window AFTER creating it? Because if you re-position the window after it has been initialized then things will look weird.

 

This isn't a plug and play thing. You actually need to go and manually create your own window animations.

I was able to fix it by starting the opening animations after the reposition, after that it looks perfect after I did the tweaking.

Share this post


Link to post
Share on other sites

Ya, that's the general idea behind the script.

If you look at the default scripts, you'll notice that the gold window is actually re-positioned after it's created, and it has the same problem.

 

I haven't found a way to address this issue though, and think it's easier to just let people hardcode the required changes into their own projects.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted