Adding text to screen
Posted: Tue Oct 13, 2015 4:29 am
According to the wiki, I can add some message text to a screen by doing something like this:
This works fine, and I get this no matter how many times I press F7 and visit the system info page:
But! If I change my code to this:and then repeatedly visit the F3 equip screen, I see this:
Notice how the text I added slowly moves down the page.
So my question is, is it possible to add text to the top of the F3 equip screen so it stays in one place? I know I could do a test and only let the code run once, but if the text I wanted to add is dynamic, I might need to update it on each refresh of the page.
Code: Select all
this.guiScreenChanged = function(to, from) {
if (to == "GUI_SCREEN_SYSTEM_DATA") {
mission.addMessageText("Testing adding text to screen");
}
}
But! If I change my code to this:
Code: Select all
this.guiScreenChanged = function(to, from) {
if (to == "GUI_SCREEN_EQUIP_SHIP") {
mission.addMessageText("Testing adding text to screen");
}
}
Notice how the text I added slowly moves down the page.
So my question is, is it possible to add text to the top of the F3 equip screen so it stays in one place? I know I could do a test and only let the code run once, but if the text I wanted to add is dynamic, I might need to update it on each refresh of the page.