Giter Club home page Giter Club logo

Comments (5)

idbrii avatar idbrii commented on July 18, 2024 1

And it looks like you can do a delay before your repeat with an empty tween:

S.tween = flux.group()

-- Declare variable before assigning so function can capture this local reference.
-- Alternative is to make the function global.
-- Prevents "expected function or callable")
local loop_heartbeat

loop_heartbeat = function()
    local time = 0.5
    S.tween:to(S.heart, 0.5, { scale = 1.2, })
        :ease("backout")
        :after(time, { scale = 1.0, })
        :ease("backin")
        :oncomplete(loop_heartbeat)
end

S.tween:to(S.heart, 2, {
        scale = 1,
    })
    :delay(2)
    :ease("elasticout")
    :after(5, {}) -- delay before loop
    :oncomplete(loop_heartbeat)

from flux.

rxi avatar rxi commented on July 18, 2024

Have you tried the macro:toggle-record and macro:play commands (ctrl+shift+; and ctrl+;)?

from flux.

tavuntu avatar tavuntu commented on July 18, 2024

OK so... I'm not sure if that was a joke and I didn't get it but I created a pull request.

from flux.

rxi avatar rxi commented on July 18, 2024

Sorry about that! The question made some sense in the context of another one of my projects, it's surprisingly easy to miss the repository title if you aren't looking for it.

Repeating a tween in flux is typically done by creating a local function that starts a tween (or sequence of tweens) and passing it as the oncomplete callback to the last tween in the chain if we want to loop it

from flux.

tavuntu avatar tavuntu commented on July 18, 2024

and passing it as the oncomplete callback to the last tween in the chain if we want to loop it

that actually makes sense, I don't know why but I thought this was going to create a stack overflow error, but now that I think about it a little more, that's not the case, I was just confused.

I guess we can close this MR since it's not really that necessary, as you pointed.

from flux.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.