设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 126|回复: 0

[转载发布] Ease Script - Animation framework

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-3 12:56:29 | 显示全部楼层 |阅读模式
    Ease Script - Animation framework 1.0.11

    By: Galenmereth / Tor Damian Design
     
    Introduction:
    So what is "easing"? Have you tried using the Move Picture event command in Ace? You'll notice that, if you move the picture's position from one spot to another, the movement in between is linear - it moves from point A towards point B in X amount of frames in equal amounts each frame. A lot of the time this is fine, but what if you want to move the pictures quickly but with a little slowing down at the end, for example for a "pop up" effect? That's what easing can do. Easing is using math to apply a modified movement curve to an object's attributes over a given period of time. Math has a tendency to sound boring, doesn't it? Video time!
     
    Examples
    (The slight choppiness in the videos is due to the recording; the actual motion is silky smooth. Fullscreen helps, but you can check out the demo to see how it runs for you)
     
    Video showing Move Picture and Tint Picture:

    Spoiler 
    The video shows how a Move Picture event and a Tint Picture event are changed based on the selected easing method; the duration and settings in the events are the same, only the applied easing algorithm changes, to often drastic effect. Here's a screenshot of how easy it is to set an easing method:





    By setting the Game_Picture.easing value to Easing::BOUNCE_OUT, all subsequent calls to Move Picture and Tint Picture are affected. You can set different easing methods for tint and move by adding another script call in between them, and there is no limit to how many pictures you can animate like this at any time. The script hooks into the update loop and replaces the default animation methods with the new easing one; as far as I can tell, there is no performance hit whatsoever.



     
    Video showing Move Route calls: 
    And the third and final video shows the script used within other scripts to easily animate Ace's default windows. This script will be an addon for this script very soon.
     
    Features:

    • Works on both Move Picture and Tint Picture
    • Available Move Route script calls for easing events and characters. These calls areease_moveto(x, y, duration, easing_method)
    • ease_moveto_char(char_id, duration, easing_method)
    • ease_opacity(opacity, easing_method)

  • 7 groups of easing methods, each with 3 variations: In, out and in-out. Also includes an improved (performance vise) version of the default Linear ease method.
  • Fully documented script - makes it very easy for scripters to use the Ease module for their own animations
  • Fully modular script setup - like the above, this will help other scripters (and myself!) extend the functionality of the Ease module with new Easing algorithms, and using the Ease module in other scripts
  • Virtually no performance hit as far as I have been able to tell, due to using mathematical algorithms to affect only the attributes of objects and hooking into the default update loop
    How to use:
    To install this script, open up your script editor and copy/paste this script to an open slot below Materials but above Main. Remember to save.

    Using with Move Picture and Tint Picture

    SpoilerBefore calling Move Picture and Tint Picture for a picture in the event editor, make a script call like this:Game_Picture.easing = Easing::ELASTIC_OUTThis will set the easing method to the ELASTIC_OUT algorithm. When you erase any picture using Erase Picture, the easing method is reset to the set default (Easing::LINEAR by default)
    You can provide different easing methods for different events as well, by setting Game_Picture.easing between each call. It is remembered for each individual event call.

    If you wish to set the default easing, you use the following in a script call:

    Game_Picture.easing_default = :quad_in# :quad_in is shorthand for Easing::QUAD_IN; works for all easing methodsYou can look at the picture linked above in the introduction section for a visual demonstration of the script call.



     
    Using with Move Routes
    SpoilerThere are 3 Move Route script calls you can use. Below are the script calls and an explanation of the parameters. You place these within an event's Move Route by using the Script button.ease_moveto(x, y, duration, easing)#--------------------------------------------------------------------------# * Move To Position# Params:# =======# - x (integer or "string")#     The x position to move to.#     if integer then absolute X position on map#     if string then relative to current position. Examples:#       "0" -> 0 from current x pos#       "-5" -> -5 from current x pos#       "5" or "+5" -> +5 from current x pos# - y (integer or "string")#     The y position to move to. Same rules as x param# - duration (integer)#     How many frames the easing should last for#  - easing
    symbol or "string")#     The easing method to apply. Default is :linear#--------------------------------------------------------------------------ease_moveto_char(char, duration, easing)#--------------------------------------------------------------------------# * Move Character To Other Character# Params:# =======# - char (integer)#     An integer noting the character to move to.#     -1 -> player#     0 -> the current object calling this method#     1 and above -> event id on the current map# - duration (integer)#     How many frames the easing should last for# - easing
    symbol or "string")#     The easing method to apply. Default is :linear#--------------------------------------------------------------------------ease_opacity(opacity, duration, easing)#--------------------------------------------------------------------------# * Ease To Opacity# Params:# =======# - opacity (integer or "string")#     Target opacity to ease to. If string, then relative to current opacity#     value. See ease_moveto's x param for more on how to use relative#     string values.# - duration (integer)#     How many frames the easing should last for#  - easing
    symbol or "string")#     The easing method to apply. Default is :linear#--------------------------------------------------------------------------Here are two examples:



     
    The above uses the relative position X and Y coordinates "0" and "+6" respectively, by setting them as strings. The duration is set as 90 frames, and the easing method is :bounce_out.
     



     
    The above uses ease_moveto to move the entity to 11x, 0y, over 90 frames, using the easing method :circ_in. An opacity ease is chained in the same call (must be separated with ";") easing the opacity to 0 over 120 frames.



     
    The following is a list of all available easing methods included by default.SpoilerYou use them in calls like this:Game_Picture.easing = :back_in# orGame_Picture.easing = "back_in"# orGame_Picture.easing = Easing::BACK_IN# It's up to you what you prefer List of easing methods:


    • LINEAR (default, and like the default in VXAce)
    • BACK_IN
    • BACK_IN_OUT
    • BACK_OUT
    • BOUNCE_IN
    • BOUNCE_IN_OUT
    • BOUNCE_OUT
    • CIRC_IN
    • CIRC_IN_OUT
    • CIRC_OUT
    • CUBIC_IN
    • CUBIC_IN_OUT
    • CUBIC_OUT
    • ELASTIC_IN
    • ELASTIC_IN_OUT
    • ELASTIC_OUT
    • EXPO_IN
    • EXPO_IN_OUT
    • EXPO_OUT
    • QUAD_IN
    • QUAD_IN_OUT
    • QUAD_OUT




    Demo
    This is a download for the demo shown in the video

    Script (direct link)
    This is a direct link with the script; this is always up-to-date with the latest build
    Side note: This script file is built using the Plugin Framework script, which you can take a look at in the demo file. There's a link to it in my signature.
     
    Github
    In case you're into github, or just want to see more details about ongoing development, check out the github repo: https://github.com/T...ss3-ease-script

    FAQ
    Q: Do I have to read the documentation before I ask a question?
    A: Preferably, yes. Pretty please? :3

    Credits and thanks
    - Galenmereth / Tor Damian Design (that's me)
    - Tsukihime: For the "Hime External Script Loader" script in the demo file
    - https://github.com/ai/easings.net: For a few of the base algorithms. Free and open source.

    License
    Free for non-commercial and commercial use. Credit greatly appreciated but not required. Share script freely with everyone, but please retain this license unless you change the script completely. Thank you.

    Author's notes
    Planned future extensions:

    • Rotate implementation (I can't extend the Rotate Picture event command due to its structure, so I will have to make a script call for this)
    • Move Route implementation with script calls (will be nice for falling meteors, bouncing balls and smooth alpha fading) Already done!
    Feel free to request an extension or modification, and please give me your feedback; it's greatly appreciated.
     
    Changelog


    • 08/12/2013 - Restructured internal workings to use the TDD module namespace and utilize an Ease_Object instead of a hash for ease object workings. Updated OP with instructions for Move Route commands.
    • 05/16/2014 - Update with a new demonstration map and greater compatibility with other scripts.
    • 11/09/2014 - TDD Ease Object updated. :from now works as intended. Fixed attribute origin setting to remove method check, since that is done in the easing module already. Demo project updated.
    • 11/09/2014 - Added support for a delay option in options hash. This makes the easing wait x amount of frames before starting. Great for easily queueing up sequential menu list animations and other nice things.
    • 11/26/2014 - Added support to use non-Hash target objects. Also documented delay option in script source comments.
    • 12/21/2014 - Bumped to version 1.0.8. All changes will now be logged in the script proper, as well as the compiled source documentation found here: https://tdd-ease-script.s3.amazonaws.com/TDD/Ease.html
    • 03/24/2015 - Fixed ease_moveto_char errors reported by aramis_ix
    • 03/29/2015 - Fixed a bug in overwrite_other_easings and register_ease that caused overwrite to not work as advertised.
    • 03/30/2015 - Implemented :same functionality for overwriting other eases, only overwriting same attributes. Default (true) works as before.


    Feeling generous?

    If you would like to give me a small tip to help me spend even more time making and maintaining these free scripts, do consider supporting me on Gratipay. Any and all support will be greatly appreciated.


    本贴来自国际rpgmaker官方论坛作者:Galenmereth处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/ease-script-animation-framework.20714/
  • 本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 06:16 , Processed in 0.143049 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表