The code below is working, but I would like to add multiple line breaks in the "longString" string. I tried adding another + System.getProperty("line.separator") + "text", but it doesn't work. The goal here is to create one image that contains text with breaks/new paragraphs so that text is not all clumped together. Once all the text is displayed under one actor, when the actor is placed into the world, I would like it to automatically get centered on the game screen.
1 2 3 4 5 6 7 8 | public Instructions() { String longString = "Gameplay:" + System.getProperty( "line.separator" ) + "If your answer is correct, one point to the Counter will be added," ; setImage( new GreenfootImage( longString , 18 , Color.WHITE, Color.BLUE)); } |