center messeges

hello everyone, I'm fairly new to quest and I'm having trouble centering text from scripts like ShowMenu and the like. I've tried editing it in HTML tools but once I've put text-align to center it just doesn't save. I've seen another post with the same problem but can't figure out where I'm supposed to type the solution they got. i don't know if it's supposed to be in the scripts tab and in code view or if I'm just not finding the save button in HTML tools. Does anyone know how to?


Right… when you edit a script, there are separate commands for "print message" and "print message centred".

For ShowMenu, there's no way to do it directly. But you could centre the menu section after it's been displayed. I'm on my phone now, so can't look up the attribute name you would need to look up. I'll try to remember it later in the day if nobody else comes up with the answer first. It should be a single JS line inserted immediately after the ShowMenu call.


I think the line you want to centre a menu is:

JS.setCss("#divOutput  ." + game.menuoutputsection, "text-align: center");

If that doesn't work, let me know and I can have a look at the code in more detail.
You would want to put that after the menu is shown, before returning control to the player. So in code view it would look something like:

ShowMenu ("What do you want?", options, true) {
  msg ("You chose "  + result + "!")
}
JS.setCss("#divOutput  ." + game.menuoutputsection, "text-align: center");

Log in to post a reply.

Support

Forums