TrickleText
jaynabonne
21 Aug 2012, 16:34This is probably fairly trivial, but I had seen a request by somone elsewhere in the forum about how to do this, and I had done it myself, so I thought I'd post, just to contribute.
This is for those times when you want some text to come in a letter at a time. The restrictions are:
1) It has to be a full screen draw.
2) You can't vary the font style.
Number 1 is due to how it draws (you have to clear the screen each time to be able to update the same spot). The "static text" parameter allows you to continuously inject the previously "trickled" text.
Number 2 has two reasons. First, some format changes (e.g. font size) are done via script commands only. Support for this could be added to the code if there were a way to dynamically build scripts at runtime. I have not seen this ability. (I have worked out a way to do it, though, with string-based metascripts, but I haven't bothered to implement it yet.)
The second reason it doesn't work is that for the format changes (bold, italic, etc) which use tags, the tags trickle out as well, and you end up with disturbing yet entertaining results when only the start tag has been emitted but not the end one. I'm sure this is solvable as well, if the desire were there for someone to actually use it.
Anyway, what I have typed here is probably more text than what's in the actual aslx file. But it's here now in case someone would like a simple "text typing" intro to their game.
This is for those times when you want some text to come in a letter at a time. The restrictions are:
1) It has to be a full screen draw.
2) You can't vary the font style.
Number 1 is due to how it draws (you have to clear the screen each time to be able to update the same spot). The "static text" parameter allows you to continuously inject the previously "trickled" text.
Number 2 has two reasons. First, some format changes (e.g. font size) are done via script commands only. Support for this could be added to the code if there were a way to dynamically build scripts at runtime. I have not seen this ability. (I have worked out a way to do it, though, with string-based metascripts, but I haven't bothered to implement it yet.)
The second reason it doesn't work is that for the format changes (bold, italic, etc) which use tags, the tags trickle out as well, and you end up with disturbing yet entertaining results when only the start tag has been emitted but not the end one. I'm sure this is solvable as well, if the desire were there for someone to actually use it.
Anyway, what I have typed here is probably more text than what's in the actual aslx file. But it's here now in case someone would like a simple "text typing" intro to their game.
guzmere
21 Aug 2012, 18:01Wow that's fabulous can the text be made up in any part of the game as opposed to just in the game section as long as you call the function in the appropriate section of my choosing.
Once again brilliant. Terry and one for luck
update yes it can
Once again brilliant. Terry and one for luck
update yes it can
jaynabonne
22 Aug 2012, 00:06Glad you are enjoying it.
Attached is the file again with one minor change: it no longer delays for space characters. That keeps it from looking uneven, since the space being printed out has no effect on the centering (so it looked like it hung a bit).
Attached is the file again with one minor change: it no longer delays for space characters. That keeps it from looking uneven, since the space being printed out has no effect on the centering (so it looked like it hung a bit).