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

2014/5/20

Changing text

1
2
danpost danpost

2014/5/20

#
You can split text up into individual lines by using the new line escape sequence, '\n'. For example
String longTextLine = "I want that this line be broken up into several different lines when printed to the terminal";
// could be
String longTextLine = "I want that this line be\nbroken up into several different lines\nwhen printed to the terminal";
The GreenfootImage constructor you are using will create the image accordingly, centering each line within the image.
danpost danpost

2014/5/20

#
Usually, the heap space error will occur when you are creating an abundance of actors or objects. Check your logic in your act methods and your loops.
You need to login to post a reply.
1
2