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

2013/4/20

How to make an image larger

1
2
3
4
danpost danpost

2013/4/20

#
Always start with the original file and only scale it once. To resize again get another original to scale.
int percentage = 150; // for 50 percent larger (adjust as needed)
GreenfootImage image = new GreenfootImage("filename.png");
image.scale(image.getWidth()*percentage/100, image.getHeight()*percentage/100);
JetLennit JetLennit

2013/4/20

#
It is staying at the exact same size the entire time
danpost danpost

2013/4/20

#
JetLennit wrote...
It is staying at the exact same size the entire time
are you setting the new images?
JetLennit JetLennit

2013/4/20

#
I think so... if that means calling the method in act
danpost danpost

2013/4/20

#
Is it supposed to change size every act cycle? and if so, then, by how much?
JetLennit JetLennit

2013/4/20

#
I'm not quite sure of either....
danpost danpost

2013/4/20

#
After you create the original image, let us say in a field called 'baseImage', you can still use:
GreenfootImage image = new GreenfootImage(baseImage);
image.scale(image.getWidth()*percentage/100, image.getHeight()*percentage/100);
setImage(image);
You can start the value of 'percentage' and a very low value (provided the scaled value of height or width does not go below one). Then, increase it by some factor each cycle before re-creating a new image.
JetLennit JetLennit

2013/4/21

#
This is what the problem is
danpost danpost

2013/4/21

#
This is what I was saying. @JetLennit, let me know when you have downloaded it, so I can delete it.
JetLennit JetLennit

2013/4/21

#
I've got it
JetLennit JetLennit

2013/4/21

#
How do i remove the color in the back?
danpost danpost

2013/4/21

#
From which image?
JetLennit JetLennit

2013/4/21

#
I am trying to get rid of the colors in base
danpost danpost

2013/4/21

#
I do not understand. What image in your scenario (need name of image and class it is in, in your scenario)?
JetLennit JetLennit

2013/4/21

#
Sorry, in the base of the Coming actor (or in yours the img actor)
There are more replies on the next page.
1
2
3
4