GithubHelp home page GithubHelp logo

Comments (7)

AurelienRibon avatar AurelienRibon commented on August 20, 2024

UTE is not bound to any framework, so you can use it to create animations for anything, even console-based apps. UTE is meant to animate Java Objects. As long as the property you want to animate has a getter and a setter (or is directly accessible), you can write a TweenAccessor for it and animate it.

from universal-tween-engine.

vishalmanchanda avatar vishalmanchanda commented on August 20, 2024

Hi Aurelien - First of all, Thanks for creating an awesome framework and we really love it.We have this requirement of being able to run UTE without launching the UI and still producing animations in the form of image frames on filesystem. We are unable to find a solution to the same using the UI based examples you have. Can you please guide us in the right direction if that's possible?

from universal-tween-engine.

AurelienRibon avatar AurelienRibon commented on August 20, 2024

The project is a bit dusty, the documentation is still hosted at google code. However, have a look at this wiki page: https://code.google.com/archive/p/java-universal-tween-engine/wikis/GetStarted.wiki

In this page, I wrote the code of an example class I want to animate, named Particle. It's just a regular plain old Java class with 2 getters and 2 setters. not related to any UI framework. Then I create a TweenAccessor for this class, to instruct UTE how to manipulate Particle instances. Finally, I call Tween.to() on instances of the class, to let the magic happen.

All this code has no relation to UI at all, it's just plain old Java objects. Just replace the Particle class with the class you want to animate.

As for producing image frames server-side, it's way beyond the role of UTE. You need to separate the concerns: have some models that abstract what you want to draw, animate those models with UTE (call tweenManager with a fixed amount of ellapsed time), and then generate your images from your model properties.

from universal-tween-engine.

vishalmanchanda avatar vishalmanchanda commented on August 20, 2024

Thanks a lot for the precise explanation and sharing the sample. We already have separated concerns and logic to produce screenshots. We will try this example and let you know if that lets us get the frame screenshots without launching the UI.

from universal-tween-engine.

kapcip avatar kapcip commented on August 20, 2024

Thanks a lot for your quick response over the issue we discussed. We tried according to what you've said. Here is a pseudocode of our code that we wrote:-

Timeline.createSequence()
        .push(Tween.to(tweenSprite,SpriteAccessor.POS_XY,100f).target(100,200))
        .start(manager);

while(tweenManager.containsTarget(tweenSprite)) {
    COUNT++;
    tweenManager.update(1f);
    Graphics2D graphics2D = bgSprite.getImage().createGraphics();
    graphics2D.drawImage(tweenSprite.getImage(),tweenSprite.getX(),tweenSprite.getY(),null)
    ImageIO.write(bgSprite.getImage(),"jpg",new File("screens/screen+"+COUNT+".jpg");
}

For rendering, we are using normal Java Graphics object and writing the animated frame/image to file system.
Above code is working though.

But we want to use a rendering framework for that, not any of our own code.
LIBGDX is one of them, as you have mentioned on your blog:-
http://www.aurelienribon.com/blog/2011/04/logic-vs-render-separation-of-concerns/

Problem with LIBGDX is, so far we know, it uses LwjglApplication or LwjglFrame or LwjglCanvas to initialise any LIBGDX Application which eventually launches a UI frame (we don't want that).

We just want the silent rendering. It should create animation frames at the backend and save it in the file system. Kinda like HeadlessApplication

It'll be great if you guide us in the right direction.

from universal-tween-engine.

AurelienRibon avatar AurelienRibon commented on August 20, 2024

I see. I'm not anymore familiar enough with LibGDX to guide you with that. At the time I was working on it (3 years ago), it did not have such a feature. Try to ask the libGDX team about a jpeg renderer instead of the common UI window, they may have many clues about how to get this done with a minimal fork (or maybe it's already part of the engine). Sorry :/

from universal-tween-engine.

kapcip avatar kapcip commented on August 20, 2024

Can we use Tween without SpriteBatch?
Using below example,
http://wiki.lwjgl.org/wiki/Render_to_Texture_with_Frame_Buffer_Objects_(FBO)
I'm able to render frames without UI Window by making some code changes.
Can we use Tween here without SpriteBatch as SpriteBatch needs a Window such as LWJGL to get initialised ( We can use SpriteBatch only after OpenGL context has been created )

from universal-tween-engine.

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.