{"id":18290543,"url":"https://github.com/dcampos/gdx-tweener","last_synced_at":"2025-04-09T07:28:42.758Z","repository":{"id":66959520,"uuid":"80680818","full_name":"dcampos/gdx-tweener","owner":"dcampos","description":"Minimal tweening library for LibGDX based projects.","archived":false,"fork":false,"pushed_at":"2024-09-25T23:44:43.000Z","size":231,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T01:43:55.499Z","etag":null,"topics":["java","libgdx","tweening-engine"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcampos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-02T00:55:34.000Z","updated_at":"2024-09-25T23:44:46.000Z","dependencies_parsed_at":"2023-05-15T22:00:23.171Z","dependency_job_id":null,"html_url":"https://github.com/dcampos/gdx-tweener","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcampos%2Fgdx-tweener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcampos%2Fgdx-tweener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcampos%2Fgdx-tweener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcampos%2Fgdx-tweener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcampos","download_url":"https://codeload.github.com/dcampos/gdx-tweener/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247997735,"owners_count":21030674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","libgdx","tweening-engine"],"created_at":"2024-11-05T14:11:22.220Z","updated_at":"2025-04-09T07:28:42.717Z","avatar_url":"https://github.com/dcampos.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tweener\n![Build status](https://github.com/dcampos/gdx-tweener/actions/workflows/gradle.yml/badge.svg)\n\nTweener is a minimal Java/LibGDX library for animating any float property you can write an accessor for.\n\nIt uses LibGDX utility classes (like Array, Pool, etc.) under the hood, so it fits nicely with the LibGDX ecosystem.\n\n## Getting Started\n\nIn order to add this library to an existing LibGDX Gradle project, add the JitPack repository to your main `build.gradle`:\n\n```gradle\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\nThen, add the dependency to the core project:\n\n```gradle\nproject(\":core\") {\n    ...\n\n    dependencies {\n        ...\n        compile \"com.github.dcampos:tweener:0.1.0\"\n    }\n    ...\n}\n```\n\n## Usage\n\nDefine one or more accessors:\n\n```java\n    public enum SpriteAccessor implements TweenAccessor\u003cSprite\u003e {\n\n        POS(2) {\n            @Override\n            public void get(Sprite object, float[] values) {\n                values[0] = object.getX();\n                values[1] = object.getY();\n            }\n\n            @Override\n            public void set(Sprite object, float[] values) {\n                object.setPosition(values[0], values[1]);\n            }\n        },\n        \n        // ...\n\n        ALPHA(1) {\n            @Override\n            public void set(Sprite object, float[] values) {\n                object.setAlpha(values[0]);\n            }\n\n            @Override\n            public void get(Sprite object, float[] values) {\n                values[0] = object.getColor().a;\n            }\n        };\n\n        int count;\n\n        SpriteAccessor(int count) {\n            this.count = count;\n        }\n\n        @Override\n        public int getCount() {\n            return count;\n        }\n    }\n```\n\nCreate a TweenManager:\n\n```java\n    private TweenManager tweenManager = new TweenManager();\n```\n\nAdd tweens to it:\n\n```java\n    duration = 1.5f;\n    \n    tweenManager.add(\n        Tweener.repeat().set(\n            Tweener.sequence().add(Tweener.parallel()\n                .add(Tweener.tween(sprite1, SpriteAccessor.ALPHA)\n                    .to(0).duration(duration))\n                .add(Tweener.tween(sprite1, SpriteAccessor.ROTATION)\n                    .to(360).duration(duration))\n                .add(Tweener.tween(sprite1, SpriteAccessor.SIZE)\n                    .to(300, 300).duration(duration))\n            ).add(Tweener.parallel()\n                .add(Tweener.tween(sprite1, SpriteAccessor.ALPHA)\n                    .to(1f).duration(duration))\n                .add(Tweener.tween(sprite1, SpriteAccessor.ROTATION)\n                    .to(0).duration(duration))\n                .add(Tweener.tween(sprite1, SpriteAccessor.SIZE)\n                    .to(200, 200).duration(duration))\n           ).add(Tweener.delay(0.5f))\n        );\n    );\n```\n\nUpdate it:\n\n```java\ntweenManager.update(deltaTime);\n```\n\nFor a complete example, see the [examples project](https://github.com/dcampos/tweener-examples).\n\n## Related projects\n\n* [Universal Tween Engine](https://github.com/AurelienRibon/universal-tween-engine): this is the original tweening engine for Java, not just for LibGDX. Unfortunately, it hasn't been actively mantained since 2013. \n* [Tween Engine](https://github.com/dorkbox/TweenEngine): an improved, actively mantained fork of the preceding one. It is a very good choice if you want a more mature library.\n* [gdx-tween](https://github.com/CypherCove/gdx-tween): another tweening library for LibGDX.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcampos%2Fgdx-tweener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcampos%2Fgdx-tweener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcampos%2Fgdx-tweener/lists"}