2015-08-23 12 views
18

मैं वास्तविक जीवन में टेक्स्ट लेखन एनीमेशन बनाना चाहता हूं, एंड्रॉइड पर यह कैसे करें? कृपया मदद करे।टेक्स्ट लेखन एनीमेशन कैसे करें?

enter image description here

+7

[लॉटी] (https://github.com/airbnb/lottie-android) – azizbekian

+0

ओपनजीएल ES ...... – Onik

+5

बेहतर एक gif बनाएं और इसे imageview –

उत्तर

4
@Behnam eskandari जवाब से

अलावा, आप भी कर सकते हैं Sprite एनीमेशन का उपयोग करें। यह छोटा और बहुत तेज़ है, और फोन पर ज्यादा जगह नहीं लेता है। इसे भी कार्यान्वित करना आसान है, आपको बस अपनी स्प्राइट शीट बनाना है। आप examples here देख सकते हैं।

Android पर इसे प्राप्त करने के लिए, आप this library का उपयोग कर सकते हैं। हालांकि इसमें कुछ सीमाएं हैं, लेकिन यह ठीक काम करती है।

यहां कोड है कि मैंने इसका उपयोग कैसे किया है।

Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.runningcat); 
int width = bitmap.getWidth(); 
int height = bitmap.getHeight(); 

int frameWidth = width/5; //you have 5 columns 
int frameHeight = height/5; //and 5 rows 
int frameNum = 25;    //there would be 25 images 


SpriteSheetDrawer spriteSheetDrawer = new SpriteSheetDrawer(
     bitmap, 
     frameWidth, 
     frameHeight, 
     frameNum) 
     .spriteLoop(true) 
     .frequency(2); //change it as per your need 


DisplayObject displayObject = new DisplayObject(); 
displayObject 
     .with(spriteSheetDrawer) 
     .tween() 
     .tweenLoop(true) 
     .transform(0, 0) //I have changed it according to my need, you can also do this by changing these values 
     .toX(4000, 0) //this one too. 
     .end(); 
//In actual example, it's set as animation starts from one end of the screen and goes till the other one. 


FPSTextureView textureView = (FPSTextureView) findViewById(R.id.fpsAnimation); 
textureView.addChild(displayObject).tickStart(); 

उम्मीद है कि यह मदद करता है।

17

आप एक पाठ या लोगो या अन्य बात चेतन करने के लिए एसवीजी उपयोग कर सकते हैं कि एसवीजी में बनने वाले

इस देखें: AnimatedSvgView

7

आप एनीमेशन एनीमेशन डिज़ाइनर से फ़ाइल और एयरबीएनबी द्वारा लॉटी लाइब्रेरी का उपयोग करने के बाद, आप इसे एंड्रॉइड ऐप पर प्रस्तुत कर सकते हैं।

यह महान सुविधाओं के साथ एक ओपन सोर्स लाइब्रेरी है, उम्मीद है कि यह आपकी समस्या का समाधान करेगा।

लोटी lib के लिए यहाँ देखें: - https://github.com/airbnb/lottie-android

यह सबसे अच्छा और आसान तरीका Android पर एनीमेशन के विभिन्न प्रकार के प्रदर्शन करने के लिए है।

आप @Behnam Eskandari द्वारा प्रदान किए गए समाधान का भी उपयोग कर सकते हैं, लेकिन एकमात्र मुद्दा यह है कि यह केवल एसवीजी छवियों के लिए है।

संबंधित मुद्दे