Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[xp]Window Advanced

Window_Advanced
Authors: Ryex
Version: 2.05
Type: Graphical Enhancement


Introduction

This is a base class like Window_Base, it contains methods for opening/closing windows with animation, as well as animated movement and resizing.


Features

  • Opening/Closing window animations
  • Two different movement algorithms
  • Two different resizing algorithms
  • Very easy to use
  • Animated cursor movement


Screenshots

http://www.youtube.com/watch?v=4sGvUk6uxL8


Demo

NA


Script






Instructions

to use simply subclass and add a finalize method and refresh method, use finalize to create the self.contents bitmap and call refresh to draw the content of the window, you can use it just like you would a normal window exsept you should NEVER create self.contents in def initialize the class has a special handling for this in def finalize.

moving? returns true if the window need moving
resizing? returns true if the window needs resizing
at_dest? returns true if the window needs neither moving nor resizing

move(x, y, mode, speed)
x > the x you want to move the window too
y > the y you want to move the window too
mode > 0 or 1 refers to the two different algorithms used for movement, default is 0
speed > the pixels the window will grow or shrink each frame should never be lower than 2, default is 2.
when mode is 1 speed works differently; when speed is 1 the window open instantly, when speed is 2 it open half the distance in the first frame half the remaining distance in the second and so on, when speed is 3 it open 30% of the remaining distance fist frame, 33.333% of the remaining distance the second and so on, when speed is 4 it moves 25% of the raining distence each frame, 5 it moves 20%, 6 > 16.666%, 7 > 14.2857%, ECT.

resize(w, h, mode, speed, pin)
w > new width
h > new height
mode > 0 or 1 refers to the two different algorithms used for resizing, default is 0
speed > the pixels the window will grow or shrink each frame should never be lower than 2, default is 2.
when mode is 1 speed works differently; when speed is 1 the window open instantly, when speed is 2 it open half the distance in the first frame half the remaining distance in the second and so on, when speed is 3 it open 30% of the remaining distance fist frame, 33.333% of the remaining distance the second and so on, when speed is 4 it moves 25% of the raining distence each frame, 5 it moves 20%, 6 > 16.666%, 7 > 14.2857%, ECT.
pin > should the top left corner be kept in the same place? true or false, default is false

NOTE: the resize method will call refresh when the window is done resizing

close(dir, mode, speed, pin)
dir > direction the window should close. o is top to bottom, 1 is left to right, 2 is both at the same time
mode > 0 or 1 refers to the two different algorithms used for resizing, default is 0
speed > the pixels the window will grow or shrink each frame should never be lower than 2, default is 2.
when mode is 1 speed works differently; when speed is 1 the window open instantly, when speed is 2 it open half the distance in the first frame half the remaining distance in the second and so on, when speed is 3 it open 30% of the remaining distance fist frame, 33.333% of the remaining distance the second and so on, when speed is 4 it moves 25% of the raining distence each frame, 5 it moves 20%, 6 > 16.666%, 7 > 14.2857%, ECT.
pin > should the top left corner be kept in the same place? true or false, default is false

NOTE: the close command disposes the contents of the window immediately and will automatically disposes of the window when the animation is complete. make sure you are aware of this when calling the update method.

NOTE: NO animation will take place unless the update method is called.

to use simple make a subclass and do what you would normal do for a selectable window but follow the instruction for AdvBase too. be sure to set the item and column maxes in the finalize method.

this class not only adds animation but it makes it easier to set up selectable windows correctly all around, the instance variable @offset controls the horizontal off set between each menu item changing it will automatically refresh the window and if you use it in you drawing methods every thing will come out right automatically. the same can be said for @row_size and @column_size these control the height of each row and the width of each column respectively and changing them will refresh the window and update the cursor.


Compatibility

should work with anything

Credits and Thanks

  • Ryex
  • WcW

Author's Notes

this class contain none of Window_Base's drawing methods so if you want them include them in you sub class

I made this... well... because I wanted to. it will make making any animated system easier

NOTE: I (the author) do NOT provide support in this thread. I simply don't visit this forum often enough. another scripter may be able to offer help but if you need support from me please go here http://forum.chaos-project.com/index.php?topic=4053.0
 
Just as a general advice, when posting scripts, do so at http://www.pastebin.com. You can highlight code in any major scripting language, such as Ruby. This way, your code will be more readable and user will be more content.

You know, I have a couple scripts just like that. I'll show you.
Dynamic Window by Juan J. Sánchez.
http://pastebin.com/4Uh9m5Zf
New Window Selectable by Juan J. Sánchez.
http://pastebin.com/pWEEnaez

By the way, I'm Juan José Sánchez.
 
I'll keep pastebin in mind
I took a quick look at thous scripts and the seem to do simaler things. Window_Advanced is far more complex in therms of what it can do though. for one the methods it uses for animated movement are more accurate and can provide effects like deceleration. for another they can do animated resizing. I can't really tell if your selectable window animates the courser like Window_Advanced though
 
The cursor slides smoothly from one place to the next, but it's not animated. I wanted to keep it as simple as possible. This way, making changes is easier. Check out the License Board video at my game's post. It'll show you what I mean. To get there, click the Medina Stories logo. If you have time, of course. : )
 
well I added a video to the first post that shows how the selectable window looks (I made the skin) and I also fixed a bug that I thought I had already fixed.
 

regi

Sponsor

The animation is nice, but I personally don't like how the cursor scrolls faster than the window (forcing you to wait for the next highlighted option to appear on screen). Otherwise, looks like a solid script.
 
well every one has their own tastes. in any case I made it so that it would be simple for people to make animated systems and it dose the job well
 
regi":356lz92k said:
The animation is nice, but I personally don't like how the cursor scrolls faster than the window (forcing you to wait for the next highlighted option to appear on screen). Otherwise, looks like a solid script.
i completely agree, nice vid too
 
I hadn't noticed the lag. It does seem like a nuisance. I believe the problem is that the cursor and the window scroll have different speeds. It should be easily fixable.

Anyhow, I have another word of advice for you. This forum uses BB code. You can embed certain objects such as You Tube videos. To do so use the code "youtube" at the beginning and "/youtube" at the end of the URL, enclosed in brackets. Let me show you.

http://www.youtube.com/watch?v=4sGvUk6uxL8
 
if the mode is change the background scrolls differently. if you really want to know I suggest you make your own window with it as it is reall hard to capture all the features in one video.

also I didn't expect this script to be the one to get all the attention. I thought it would be my CMS battle system or dynamic weather script. not this mundane scripting tool
 
To be brutally honest, and I think you'll thank me for this, Ryexander, there are better battles systems out here in the forums, and some pretty amazing weather and particle effects scripts. This, on the other hand, is unique.
 
ah, well if we are going by unique then Dynamic sounds and Dynamic Weather are certainly one of a kind.
but ya it makes sense when you put it like that. I didn't mean to imply that I though those scripts were better than everything else just that I felt they were more noteworthy than this here tool.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top