There's one last class to update. Open LevelEndScreen
, and add the imports:
import ui.Strings; import ui.StringIDs;
Go to the constructor and replace the line where the text
property on txtGameScore
is set with this:
txtGameScore.text = Strings.instance.getValue(StringIDs.SCORE) + score;
Next, go to the line where the text
property on txtBestScore
is set and replace it with:
txtBestScore.text = Strings.instance.getValue(StringIDs.BEST_SCORE) + Reg.score;
Finally, go to the line where btnPlayAgain
is instantiated and replace it with this:
btnPlayAgain = new FlxButton(0, 0,Strings.instance.getValue(StringIDs.PLAY_AGAIN), onPlayAgain);
Now with this, we're done! If you run the game now, it should look exactly as it did before, but now all of the text is customizable. It may be a little anticlimactic, but it will save you some serious headaches if the text in the game needs to change.