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

2016/4/9

How do you invoke methods on array?

orangutan orangutan

2016/4/9

#
How can I invoke mirrorHorizontally() to an array which has GreenfootImage as its type?
Super_Hippo Super_Hippo

2016/4/9

#
So you want to mirror a set of images?
GreenfootImage[] images = {new GreenfootImage("a.png"), new GreenfootImage("b.png"), new GreenfootImage("c.png")};

for (int i=0; i<images.length; i++) images[i].mirrorHorizontally();
You need to login to post a reply.