{"id":21130010,"url":"https://github.com/MasayukiSuda/FPSAnimator","last_synced_at":"2025-07-09T01:32:02.196Z","repository":{"id":50301394,"uuid":"48978629","full_name":"MasayukiSuda/FPSAnimator","owner":"MasayukiSuda","description":"FPSAnimator is very easy animation library for Android TextureView and SurfaceView.","archived":false,"fork":false,"pushed_at":"2019-01-10T08:26:37.000Z","size":3310,"stargazers_count":753,"open_issues_count":3,"forks_count":120,"subscribers_count":22,"default_branch":"master","last_synced_at":"2023-11-07T16:29:28.771Z","etag":null,"topics":["android","android-textureview","animation","animation-library","spritesheet","surfaceview","textureview","tween"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MasayukiSuda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-04T06:22:00.000Z","updated_at":"2023-11-03T06:10:31.000Z","dependencies_parsed_at":"2022-09-08T01:22:39.327Z","dependency_job_id":null,"html_url":"https://github.com/MasayukiSuda/FPSAnimator","commit_stats":null,"previous_names":[],"tags_count":13,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasayukiSuda%2FFPSAnimator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasayukiSuda%2FFPSAnimator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasayukiSuda%2FFPSAnimator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MasayukiSuda%2FFPSAnimator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MasayukiSuda","download_url":"https://codeload.github.com/MasayukiSuda/FPSAnimator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225476379,"owners_count":17480215,"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":["android","android-textureview","animation","animation-library","spritesheet","surfaceview","textureview","tween"],"created_at":"2024-11-20T05:32:10.730Z","updated_at":"2024-11-20T05:32:13.415Z","avatar_url":"https://github.com/MasayukiSuda.png","language":"Java","funding_links":[],"categories":["Libs"],"sub_categories":["\u003cA NAME=\"Animations\"\u003e\u003c/A\u003eAnimations"],"readme":"# FPSAnimator\n[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![API](https://img.shields.io/badge/API-16%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=16)\n[![Android Weekly](https://img.shields.io/badge/Android%20Weekly-%23194-blue.svg?style=true)](http://androidweekly.net/issues/issue-194)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FPSAnimator-green.svg?style=true)](http://android-arsenal.com/details/1/3219)\n\n\nA simple but powerful Tween / SpriteSheet / ParabolicMotion / animation library for Android TextureView and SurfaceView.\n\n# Features\n* The controls Fps possible to animation.\n* Possible for animation of Tween and SpriteSheet and ParabolicMotion in one of TextureView.\n* Possible to animate with low load on the terminal.\n* 28 types of Easing\n\n# Basic Usage\nGradle\n```groovy\n    dependencies {\n        // jCenter\n        compile 'com.daasuu:FPSAnimator:0.2.4.0'\n    }\n```\nInclude the FPSTextureView widget in your layout. Set FPS by attribute.\nDefault FPS is 30.\u003cbr\u003e\nIf you use SurfaceView , use FPSSurfaceVIew.\n```xml\n    \u003ccom.daasuu.library.FPSTextureView\n        android:id=\"@+id/animation_texture_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:FPSAnimator_fps=\"24\"\n        /\u003e\n```\nIn your onCreate method (or onCreateView for a fragment), bind the widget.\n```JAVA\n    private FPSTextureView mFPSTextureView;\n    \n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_easing_sample);\n        mFPSTextureView = (FPSTextureView) findViewById(R.id.animation_texture_view);\n    }\n```\nCreate an instance of the DisplayObject, please add it to the FPSTextureView.\n```JAVA\n    Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher);\n    \n    DisplayObject bitmapDisplay = new DisplayObject();\n    bitmapDisplay\n            .with(new BitmapDrawer(bitmap))\n            .tween()\n            .toX(1600, windowWidth - bitmap.getWidth(), Ease.BACK_IN_OUT)\n            .waitTime(1000)\n            .alpha(1000, 0f)\n            .alpha(1000, 1f)\n            .end();\n            \n    mFPSTextureView\n                .addChild(bitmapDisplay)\n                .tickStart();\n```\n\u003cimg src=\"art/tweenBitmapSampleDemo.gif\" width=\"32%\"\u003e\n\nThe example above will create a new tween instance that:\n* tweens the target to an x value of rightSide over 1600ms\n* waits 1000 ms\n* tweens the target's alpha from  1 to 0 over 1s\n* tweens the target's alpha from 0 to 1 over 1s\n\n# Example\nThis is the implementation of the sample application.\n\n#### SpriteSheet\n\u003cimg src=\"art/spriteSheet.gif\" width=\"50%\"\u003e\n\n\n```JAVA\n    \n    SpriteSheetDrawer spriteSheetDrawer = new SpriteSheetDrawer(\n        spriteBitmapB, \n        frameWidth, \n        frameHeight, \n        frameNum)\n        .spriteLoop(true);\n    \n    DisplayObject displayObject = new DisplayObject();\n    displayObject\n            .with(spriteSheetDrawer)\n            .tween()\n            .tweenLoop(true)\n            .transform(-frameWidth, windowHeight / 2)\n            .toX(3000, windowWidth)\n            .end();\n\n    mFPSTextureView\n                .addChild(displayObject);\n```\n[SpriteSheet wiki](https://github.com/MasayukiSuda/FPSAnimator/wiki/SpriteSheet-Animation)\n\n#### TweenText\n\u003cimg src=\"art/tweenTextDemo.gif\" width=\"50%\"\u003e\n\n```JAVA\n    Paint paint = new Paint();\n    paint.setColor(ContextCompat.getColor(this, R.color.colorAccent));\n    paint.setTextSize(Util.convertDpToPixel(16, this));\n\n    String tweenTxt = \"TweenText\";\n    float textWidth = paint.measureText(tweenTxt);\n    \n    TextDrawer textDrawer = new TextDrawer(tweenTxt, paint)\n            .rotateRegistration(textWidth / 2, textWidth / 2);\n\n    DisplayObject textDisplay = new DisplayObject();\n    textDisplay.with(textDrawer)\n            .tween()\n            .tweenLoop(true)\n            .transform(0, 800)\n            .waitTime(300)\n            .to(1000, windowWidth - textWidth, 800, 720f, Ease.SINE_OUT)\n            .waitTime(300)\n            .to(1000, 0, 800, 0f, Ease.SINE_IN)\n            .end();\n\n```\n\n#### TweenBitmap\n\u003cimg src=\"art/scaleAndAlpha.gif\" width=\"16%\"\u003e\n```JAVA\n        BitmapDrawer bitmapDrawer = new BitmapDrawer(bitmap)\n            .dpSize(this)\n            .scaleRegistration(bitmap.getWidth() / 2, bitmap.getHeight() / 2);\n\n        DisplayObject bitmapDisplay = new DisplayObject();\n        bitmapDisplay.with(bitmapDrawer)\n                .tween()\n                .tweenLoop(true)\n                .transform(300, 400)\n                .to(500, 300, 400, 0, 6f, 6f, 0, Ease.SINE_IN_OUT)\n                .waitTime(300)\n                .transform(300, 400, Util.convertAlphaFloatToInt(1f), 1f, 1f, 0)\n                .waitTime(300)\n                .end();\n\n```\n[TweenAnimation wiki](https://github.com/MasayukiSuda/FPSAnimator/wiki/Tween-Animation)\n\n#### ParabolicMotion\n\u003cimg src=\"art/parabolicDemo.gif\" width=\"50%\"\u003e\n\n```JAVA\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_easing_sample);\n        mFPSTextureView = (FPSTextureView) findViewById(R.id.animation_texture_view);\n        \n        // ParabolicMotionText\n        Paint paint = new Paint();\n        paint.setColor(ContextCompat.getColor(context, R.color.colorPrimary));\n        paint.setTextSize(Util.convertDpToPixel(20, context));\n        \n        TextDrawer textDrawer = new TextDrawer(\"Text\", paint);\n        \n        DisplayObject textDisplay = new DisplayObject();\n        textDisplay.with(textDrawer)\n                .parabolic()\n                .transform(800, 800)\n                .initialVelocityY(-40)\n                .end();\n\n        mFPSTextureView.addChild(textDisplay);\n    }\n\n    private void createParabolicMotionBitmap() {\n        final DisplayObject bitmapDisplay = new DisplayObject();\n\n        bitmapDisplay.with(new BitmapDrawer(mBitmap).dpSize(context))\n                .parabolic()\n                .transform(0, mFPSTextureView.getHeight())\n                .reboundBottom(false)\n                .accelerationX((float) (15 + Math.random() * 7))\n                .initialVelocityY((float) (-65 + Math.random() * 15))\n                .bottomHitCallback(new AnimCallBack() {\n                    @Override\n                    public void call() {\n                        mFPSTextureView.removeChild(bitmapDisplay);\n                    }\n                })\n                .end();\n\n        mFPSTextureView.addChild(bitmapDisplay);\n    }\n\n    @Override\n    protected void onResume() {\n        super.onResume();\n        mFPSTextureView.tickStart();\n\n        mTimer = new Timer();\n        mTimer.schedule(new TimerTask() {\n            @Override\n            public void run() {\n                for (int i = 0; i \u003c 5; i++) {\n                    createParabolicMotionBitmap();\n                }\n            }\n        }, 0, 100);\n    }\n\n```\n[ParabolicMotion wiki](https://github.com/MasayukiSuda/FPSAnimator/wiki/ParabolicMotion-Animation)\n\n#### Container\n A Container is a nestable display list that allows you to work with compound display elements.\u003cbr\u003e\n For example you could group arm, leg, torso and head Bitmap instances together into a Person Container,\n and transform them as a group, while still being able to move the individual parts relative to each other.\n Children of containers have their transform and alpha properties concatenated with their parent Container.\u003cbr\u003e\n Containers have some overhead, so you generally shouldn't create a Container to hold a single child.\n\n\n\n# Easing\n\u003cimg src=\"art/easingDemo.gif\" width=\"80%\"\u003e\n\nApplications using FPSAnimator\n-------\n\nPlease send a pull request if you would like to be added here.\n\nIcon | Application\n------------ | -------------\n\u003cimg src=\"https://lh3.googleusercontent.com/61DRGI2kIEf-edob9g2mHkEax0k69yiFEZ8y6O2pQUdBYg706a1BQaepqUcyy1UJHOw=w300-rw\" width=\"48\" height=\"48\" /\u003e | [CChannel](https://play.google.com/store/apps/details?id=tv.cchan.harajuku)\n\n\n\nContributers\n-------\n\n* [m1noon](https://github.com/m1noon)\n\n## License\n    Copyright 2016 MasayukiSuda\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMasayukiSuda%2FFPSAnimator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMasayukiSuda%2FFPSAnimator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMasayukiSuda%2FFPSAnimator/lists"}