This site requires JavaScript, please enable it in your browser!
Greenfoot back
AceticAcid
AceticAcid wrote ...

2012/11/17

drawLine Method in World's subclass

AceticAcid AceticAcid

2012/11/17

#
How can use drawLine method in World's subclass? Plz give me some advice...T^T
Upupzealot Upupzealot

2012/11/17

#
Do you mean draw line in the background of a World.
Upupzealot Upupzealot

2012/11/17

#
Try this:
world.getBackground().drawLine(x0, y0, x1, y1);
amin amin

2012/11/17

#
right, but first you have to import : import java.awt.Color; at the top of ur class
AceticAcid AceticAcid

2012/11/17

#
Oh, I got it, tnx! but.. there appeard some problem, I want to express circle with line, Math.sin() method doesn' operate well though Math.cos() method operate very well;
Upupzealot Upupzealot

2012/11/17

#
Why not use the method drawOval(int, int)? If you insist on this you may publish your code here.
AkilaKcetIT AkilaKcetIT

2016/2/5

#
I too want to draw 1,2,3....9 in my game. I want to use line and Oval method for doing this.. Is it OK? or any other better options to do this?
davmac davmac

2016/2/5

#
AkilaKcetIT wrote...
I too want to draw 1,2,3....9 in my game. I want to use line and Oval method for doing this.. Is it OK? or any other better options to do this?
Please do not post in years-old discussions - start a new discussion, and post a link to the old discussion if you like.
You need to login to post a reply.