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

2020/10/21

Greenfoot drawLine

off.nika off.nika

2020/10/21

#
Hi, can you help me how to draw a Line in greenfoot? Our teacher give us this and we dont know what to do. For this task, try creating a "drawRow" method that draws a horizontal line from edge to edge. And a method that draws a purple circle. we did this and its not working
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Write a description of class line here.
 * 
 * @author Nicol Ševčíková  
 * @version 1.0
 */
public class line extends Actor
{
  private GreenfootImage img = new GreenfootImage(50,50);
  
   public void drawLine () {
       img.drawLine (0,0,50,50);
       img.setColor (new Color(100,50,0));
    } 

}
please help us thank uuu
off.nika off.nika

2020/10/21

#
I have it. Dont need help. Thank you.
You need to login to post a reply.