repaint() ? redraw()?

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

repaint() ? redraw()?

Postby tagazok » Fri Mar 14, 2008 12:40 am

Hello,
I make a Game of life and I have a little problem.
With java, when I make a PaintComponent, I can use repaint() method but for my game, I make a Canvas (I took the example of the API DrawPoints) but how can I redraw my canvas? is there a redraw method like repaint() for PaintComponent?

thx :)
L'idiot ne savait pas que cela était impossible...
...alors il l'a fait.
tagazok
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sun Nov 18, 2007 4:39 pm
Location: Nice / Paris

Top

Postby res » Sat Mar 15, 2008 10:56 pm

Use invalidate() in your View which calls onDraw(Canvas), for more information visit

http://code.google.com/android/referenc ... nvalidate()
res
Senior Developer
Senior Developer
 
Posts: 146
Joined: Tue Nov 20, 2007 8:14 pm
Location: United States

Postby tagazok » Sun Mar 16, 2008 4:57 pm

yeah !!!!!!!!!!!!!
It's works very well! :D

thx :)
L'idiot ne savait pas que cela était impossible...
...alors il l'a fait.
tagazok
Junior Developer
Junior Developer
 
Posts: 12
Joined: Sun Nov 18, 2007 4:39 pm
Location: Nice / Paris

Postby com2usprav » Wed Apr 16, 2008 6:08 pm

I thinnk this invalidate works for the Normal Cavas . How one has to perform animation for Overlay container that is drawn over maps . I am not able to do can any one help me in this .

Cheers
Pravin Kumar
User avatar
com2usprav
Developer
Developer
 
Posts: 26
Joined: Sat Mar 29, 2008 3:28 pm
Location: Bangalore

Postby com2usprav » Mon Apr 28, 2008 9:32 am

Hey I ve Found a Method to use animated Overlay in Android using this draw method one can achieve the ANimated Overlays in indroid

In overlays invalidate() method will not work

The long wait in the draw Method parameters will Make the Overlays to get refreshed in wait times.

public boolean draw(Canvas canvas, PixelCalculator pixelCalculator, boolean b,long wait)
{
super.draw(canvas, pixelCalculator, b,1000);
}
User avatar
com2usprav
Developer
Developer
 
Posts: 26
Joined: Sat Mar 29, 2008 3:28 pm
Location: Bangalore

Postby ioRek » Wed Jun 24, 2009 2:32 pm

where did you find this method draw with the delay ?
ioRek
Freshman
Freshman
 
Posts: 9
Joined: Mon Jun 22, 2009 3:10 pm

Top

Postby donalduck0304 » Mon Nov 02, 2009 1:31 pm

Can you please show example with that method (invalidate() or postInvalidate())?

Thanks in advance
User avatar
donalduck0304
Freshman
Freshman
 
Posts: 6
Joined: Tue Oct 20, 2009 10:38 am

Top

Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests