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

2016/6/13

Line break

Lio1020 Lio1020

2016/6/13

#
Hi, how do we do a line in a string with text ? I want to display a long text but it's too long for my screen so I want to add line break.
1
2
3
String text = "Utilisez les flèches pour diriger le joueur, espace pour tirer sur les monstres";
            GreenfootImage instructions = new GreenfootImage(text, 30, Color.BLACK, Color.WHITE);
            setImage(instructions);
Super_Hippo Super_Hippo

2016/6/13

#
Write \n at the position you want a new line to begin.
You need to login to post a reply.