-7
What function do I use to get an animation of credits , where the letters will flow in front of the screen , in the case of bottom to top ?
-7
What function do I use to get an animation of credits , where the letters will flow in front of the screen , in the case of bottom to top ?
0
J Matthew. I’ll explain to you briefly the logic of how I did it. I would create a timer that 50 on 50 or 150 on 150, that would draw the text/credits decreasing the position.
The code would be something like this:
public static void main(String[] args) {
int X,Y;
TimerTask mudarCreditos= new TimerScheduleFixedRateDelay();
Timer tempo = new Timer();
tempo.scheduleAtFixedRate(tasknew,tempo para começar pode ser 0,tempo para repetir 150);
}
// este metodo é o que vai acontecer de 150 em 150 ms
public void run() {
//diminuir 20px de cada vez pode ser o Y ou ambos
//X-=20;
Y-=20;
TextView txtView = (TextView) findViewById(R.id.textView);
txtView.setX(X);
txtView.setY(Y);
//Invalidate serve para redesenhar
invalidate();
}
The way you’re gonna do it invalidate and the objects will depend on whether to use an XML layout or a programmable layout.
I hope I’ve helped
Browser other questions tagged android
You are not signed in. Login or sign up in order to post.
But and the text , I should put it inside a Textview even , to call it ?
– J.mateus
Yes you can put it inside a Textview, in the code I already updated ;)
– BrnPer
The answer was essential , thank you!.
– J.mateus
I hope it was helpful to help you solve that problem. But a piece of advice next time you comment here on the forum reminds you of those tips I gave and remember to always post a code image to help us understand better. Also try to be as simple and clear as possible
– BrnPer
My next comments will be simpler and clearer, I’m using stack overflow for a while,.
– J.mateus
No problem ;)
– BrnPer
Regarding imagemView ,how can I get the action of clicking on it and making a jump?
– J.mateus
Put this in the Imageview settings
android:clickable="true"
and then the codeimgView.setOnClickListener(new View.OnClickListener() {
 //@Override
 public void onClick(View v) {
 Log.v(TAG, " click"); 
 } 
});
– BrnPer
I understood the action of (click) on the image Iew , but the image jump , how can I get this action by clicking?
– J.mateus
I jump like this?
– BrnPer
When you click on Imageview it goes up and then goes back down ,I am developing a game and I would need this function to continue.
– J.mateus
I told you how Matthew, you do that
.setY
and then after a while you fade again– BrnPer