MODULE: TypedText 1.0.0

Started by Crimson Wizard, Sun 12/02/2017 22:53:14

Previous topic - Next topic

Crimson Wizard

#60
About what to put and not put into the script header:
https://adventuregamestudio.github.io/ags-manual/TheScriptHeader.html

Importing and exporting variables is explained in this topic in the manual:
https://adventuregamestudio.github.io/ags-manual/ImportingFunctionsAndVariables.html

But it seems that you don't need to make any variables public here, they must not be read or set from other place, so you may just hide them inside the script, and have only function "imports" in the header.


I might also recommend not putting this into "globalscript", but make a separate script module for the code related to this "typewriter".


This code has no use at all, this was added to the module's code for compatibility with other versions of AGS:
Code: ags
#ifndef SCRIPT_API_v350
  #define eAlignCenter eAlignCentre
#endif
so you may throw it out.

Throw out any other code that you dont use or which is not working for your case.

TypewriterTextLover

Thank you Crimson Wizard! Everything we talked about finally clicked! I have learned a lot and understand modules, importing, where to put variables, simplying code, and I even wrote my own functions today and..... THEY WORKED!!! All of the typewriter text is working perfectly with zero hangups and even controlled completely through mouse clicks that wait on user input in and... IT'S IN IT'S OWN MODULE! THANK YOU!!!!!!!!  (laugh)  (laugh)  (laugh)


Crimson Wizard

I see now that I should have rather made a simpler demo game featuring the most common textbox which prints character speech or game narration.

TypewriterTextLover

If you ever update the demo, I think the caret code could be a bit better perhaps. It seems to not work if you use transparent backgrounds like say if you use COLOR_TRANSPARENT, it shows every tick of the caret sprite moving. This forced me to use a single color for the paper instead of a very worn looking detailed paper than I initally planned. I also had to use a smaller caret than I would have liked since the caret in the demo seems to be lower than the text and not evenly centered with the font height. I just altered my sprite a bit to make it center with extra spaces, but that just eats up pixel space I could have used to make the sprite more detailed. I tried messing around with the caret code with no luck.

Just nitpicks though. 700,000 views !!!!  8-)

I also added a FirstPage function that basically replaces the initial ttdraw.

So now if you want to type first page you do FirstPage("text string")
If you want more pages then you use AddPage("text string").

Thank you for everything!

SMF spam blocked by CleanTalk