Répondre

3

Pour le mode anticrénelage utiliser public void setDrawingStyle(int drawStyle, boolean on)

Pour les lignes utilisent

graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, true); 
graphics.drawLine(x1, y1, x2, y2); 
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AALINES, false); 

Pour utiliser poligons

graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, true); 
graphics.drawRect(x, y, width, height); 
graphics.setDrawingStyle(Graphics.DRAWSTYLE_AAPOLYGONS, false); 
+0

Merci .. Je ne peux pas voir son effet dans Simulator. Je vais le tester sur Storm. – Shreyas

+1

Le drapeau 'DRAWSTYLE_AAPOLYGONS' s'applique également aux cercles et aux ellipses. Son effet est perceptible dans les simulateurs, mais vous devrez probablement augmenter le zoom à 4x. –

Questions connexes