Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> [XP] Window_Advanced movement and more (scripting tool)
Ryex
post Oct 18 2009, 08:27 PM
Post #1


Level 3
Group Icon

Group: Member
Posts: 34
Type: Scripter
RM Skill: Masterful




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


Window_Advanced_Base
http://docs.google.com/View?id=dgb5wg25_11cbqt8vvz


Window_Advanced_Selectable
http://docs.google.com/View?id=dgb5wg25_1288zn84d9



Instructions

Instructions for both AdvBase and AdvSelectable

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.




AdvSelectable only instructions

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

This post has been edited by Ryex: Nov 25 2010, 05:00 PM


__________________________
Time: if it was truly linear I wouldn't be here and the world would be knee deep in ashes.

RPG Maker PY (RMPY) A Replacement RMXP Editor
Go to the top of the page
 
+Quote Post
   

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd May 2013 - 09:28 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker