Wait for key press, then
JenniferKline
28 May 2017, 13:22First time using this feature, so just a couple of questions.
Is there a way to change the hyperlink colour? Now I know I can change hyperlink colours in other situations, and really, I don't feel I even need the hyperlink to show up, as I already have a centred message telling the player to press any key. But I get a Continue... that appears in the corner of my page.
Is there a way to prevent this little message coming up with the use of the 'Wait For Key Press, Then' or some way to change the message or colour? On another note, is there a way to make things occur with only the press of a specific key? Say, Press W to Continue? Not something I need, just curious - although I assume that would be something to do with input.
Many thanks!
The Pixie
28 May 2017, 14:28To change the text, over-ride the ContinueLabel template.
To change the style, modify the #endWaitLink
element. Counter-intuitively, this has to be done after the wait command, like this:
msg ("here")
wait {
msg ("there")
}
JS.eval ("$('#endWaitLink').css('color', 'red');")
See here for setting styles like that.
The get key presses accepted, you would need some JavaScript to capture them. It would be possible, but tricky, and may be confusing if the player types WEAR HAT, and ends up going west, then back east!
JenniferKline
28 May 2017, 18:10Great, worked like a charm. Bottom left, searched Continue, hit copy, delete the 'Continue...' and I can set my own message. I tried with the scripting, but I don't think I did it right and it crashed my game, so I might approach that another time. But thanks for the help, the game is back rolling! ^__^
The Pixie
28 May 2017, 20:32What did you try that made it crash? Iff you could paste the code into a post?
Dcoder
30 May 2017, 12:04Pixie, when changing the style for the endWaitLink element, can you change the font, font size, or alignment (centered)? Thanks.
The Pixie
30 May 2017, 14:43Try these (second shows fallback option for fonts):
JS.eval ("$('#endWaitLink').css('font-family', 'sans-serif');")
JS.eval ("$('#endWaitLink').css('font-family', '\"Times New Roman\", Georgia, Serif');")
JS.eval ("$('#endWaitLink').css('font-size', '20pt');")
For reasons unknown, centering is not that well supported in CSS, despite being part of the much older HTML, but this may work:
JS.eval ("$('#endWaitLink').css('margin', 'auto');")
JS.eval ("$('#endWaitLink').css('width', '50%');")
Dcoder
30 May 2017, 15:51The first 3 (font and font size) work. The last 2 (centering) don't work. Still, this is very cool!