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

[转载发布] Iavra Animate Everything (+ Easing Library)

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

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Description


            Provides a generic way to animate every float property on every obj


    Author


            Iavra


    Parameters


    @param Enable Persistence
    @desc If set to true, running animations will be stored in the savefile and continued after loading.
    @default false




    How to Use


            To animate an object a new Tween has to be created and started like this:


    var myTween = new IAVRA.ANIMATE.Tween(object, {_x : 100}).duration(50).start();


            This will cause the property "_x" of "object" to change from its current value to 100 over the next 50 frames, using linear easing (default).


            The IAVRA.ANIMATE.Tween class contains the following functions:

                            start()


                                    Starts the animation.


                                    stop()


                                    Stops the animation. It can be restarted, but the current progress isn't saved.


                                    pause()


                                    Pauses the animation. It can be restrated at any time by calling resume().


                                    resume()


                                    Resumes the animation that has previously been pause()-d.


                                    easing(easing)


                                    Specified the easing function to be used by the tween. By default, linear (no) easing is used. An easing function takes a single parameter k, which is defined as t/d, meaning "current animation step" / "total duration" and can range from 0.0 to 1.0. It must return a value of X, which will be used to calculate the current value as: start + (end - start) * X.


                                    duration(duration)


                                    Sets the animation duration. The default value is 1 and causes the animation to complete instantly. Values lower than 1 will throw an error.


                                    delay(delay)


                                    Causes the animation to pause for a given number of steps and can either be used to delay the start of the animation or to pause it during its execution. Values lower than 1 have no effect.


                                    onStart(callback)


                                    Registers a callback, which will be invoked when the animation starts. The callback receives the animated object as a parameter.


                                    onUpdate(callback)


                                    Registers a callback, which will be invoked when the animation proceeds by one step. The callback receives the animated object as a parameter.


                                    onComplete(callback)


                                    Registers a callback, which will be invoked when the animation completes. The callback receives the animated object as a parameter.


                                    onStop(callback)


                                    Registers a callback, which will be invoked when the tween's stop() function is called. The callback receives the animated object as a parameter.


                                    chain(...)


                                    Takes any number of IAVRA.ANIMATE.TWEEN objects, that will be started once this animation completes. Please ensure not to call start() on the chained objects, as this would cause them to be started twice.


                                    access(get, set)


                                    Takes 2 callback functions, that will be used to read and write properties on the object being animated. The get callback takes 2 parameters, the object and name of the property being read. The set callback takes 3 parameters, the object, the name of the property to write and the value it should be set to.               
    Click to expand...


            All functions return the Tween object itself and can be used for chaining.


            The IAVRA.ANIMATE module contains the following functions:

                            clear()


                                    Forcefully stops all currently running animations without triggering callbacks or starting chained tweens.               
    Click to expand...


            By default, animations are saved locally and get lost after saving and loading the game. The parameter "Enable Persistence" changes this and stores all animations in the savefile. Note that JSON.stringify() (which MV uses as its save mechanism) discards functions, which means that registered callbacks are lost after loading a game.


            The second script contains JavaScript implementations of the Robert Penner easing functions, which can be used like this:


    new IAVRA.ANIMATE.Tween(object, {...}).easing(IAVRA.EASING.quad.in).start();




    Terms of Use


            Free to use for both commercial and non-commercial games. Please give credit.


            If you use the Easing Library, you must give credit to Robert Penner.


    Download


            Animate Everything: http://pastebin.com/WqZ1Sfs5


            Easing Library: http://pastebin.com/Y6kMyksm


    FAQ


            Q: Can i rename the script or will it break?


            A: You are free to name the files however you want, since i'm using my own method for loading parameters, which doesn't use the filename.


    本贴来自国际rpgmaker官方论坛作者:Iavra处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/iavra-animate-everything-easing-library.46826/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 03:38 , Processed in 0.112758 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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