Coder Social home page Coder Social logo

Comments (4)

u10int avatar u10int commented on June 16, 2024

At first I avoided automatically forcing anti-aliasing for all transforms since it should probably be user-controlled, but I agree there should be an easy way to enable and disable for specific tweens.

I just pushed up a commit that adds this functionality, and edge antialiasing is enabled for all tween objects by default since this is most likely the desired result. If you wish to override this value for a specific Tween or Timeline instance, use the antialiasing property on that instance.

from kinetic.

markuswinkler avatar markuswinkler commented on June 16, 2024

Just tested, works great!
This kind of implementation has a couple drawbacks though since you need to create an instance first before you can reference bool value.

e.g. you have to write

let t=Kinetic.to(square, duration: 1, options: [ .Rotate(1) ])
t.antialiasing = false
t.onComplete { (anim) -> Void in
     t.antialiasing = true
}
t.play()

which can add a lot of boilerplate code in case of nested Timeline animations

vs.

let t=Kinetic.to(square, duration: 1, options: [ .Rotate(1) ]).autoAntialias(false).play()

from kinetic.

u10int avatar u10int commented on June 16, 2024

Right now I think I'll leave it as a property rather than chained method as it's probably not something that will ever be disabled very often. Can't think of a reason you'd every want to disable antialiasing for layer transforms other than a slight performance gain for complex animations. I can revisit later if keeping it as a property become more of a pain for a lot of users.

from kinetic.

markuswinkler avatar markuswinkler commented on June 16, 2024

Fair enough.
One use case I could think of if you have an animation in a table cell, antialiasing there would affect scrolling, but yeah, it's more on the rare end, especially with current hardware.

from kinetic.

Related Issues (20)

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.