Lua Texter

  • FeynmanLogomaker
    29th Sep 2013 Member 0 Permalink

    Lua Texter

     

    Get the code here and the font here. You can also get a font generator here.

     

    Save the script as anything you want, but the font HAS to be saved as 'texter_basic.txt' (or you can modify the script itself; just replace every 'texter_basic.txt' you find with the other filename).

     

    USAGE:

         Type in console (` key): drawText([text string], [position x], [position y])

         Or, press the 't' key and type the text to be plotted in the boxes; it will be drawn at the mouse coordinates.

     

    Changelog:

     

    0.5: Added lower case letters

    1.0: Added descender compatibility -now it no longer looks like a display from a 1980s cash register.

    1.7: Added kerning compatibility - Yay, no more monospace!

    2.3: Added upper case - finally starting to look like a real texter.

    2.5: Added numbers.

    3.0: Added a basic GUI - Not much, but it's a start.

    3.1: Removed a bit of junk code.

    4.0: Added generator! Now to allow choice of fonts...

    4.2: Added font changing option, changed font.done to automatically make the [NULL] character.

    5.0: Added a real font editor!

     

    To-do:

     

    ADD:

         

    [[Key-activation - drawing it at the cursor position when you press 't' key, for example.]] DONE

         

     

         Punctuation - it's great being able to draw text quickly, but it can get annoying having to draw

         exclamation points in yourself.

     

    CHANGE:

     

         Nothing yet.

     

    The command:

    Texter: Console command

     

    The GUI:

    THe GUI

     

    The font so far:

    Texter Font

     

    Currently 1071 lines long.

    Edited 16 times by FeynmanLogomaker. Last: 5th Oct 2013
  • Nobody905
    30th Sep 2013 Member 0 Permalink

    You're using my Lua mod! Yay!

    Nice script. Long...

  • FeynmanLogomaker
    30th Sep 2013 Member 0 Permalink

    Nobody905:

    You're using my Lua mod! Yay!

    Nice script. Long...

     

    Thanks, although the length is mostly the font :)

     

    And I tend to use every Lua mod I can find. (Yours was really good though)

  • xetalim
    30th Sep 2013 Member 0 Permalink
    @FeynmanLogomaker (View Post)
    Wasnt there a lua texter mod already?
  • boxmein
    30th Sep 2013 Former Staff 0 Permalink
    IMHO @byzod's texter still reigns supreme :D
    Also you could totally do some bit compression with your basic font, since TPT has a bit api
  • FeynmanLogomaker
    30th Sep 2013 Member 0 Permalink

    Indeed, Byzod's texter is still better...but I aim for this one to at least be considered for its fonts. I'm actually working on a font generator that can be called with a button press to read from a TPT save, or from the console to read from a file using the LuaGD library, and even take a .TTF file and convert it to a Lua script usable by my texter.  --EDIT: Done with the generator!

     

    And yes, bit compression would be a cool idea, I'll have to try that when I get back to my computer. Although, I suppose I could always use .luac files for the fonts instead of .txt.

    Edited once by FeynmanLogomaker. Last: 1st Oct 2013
  • EvanLink
    5th Oct 2013 Member 0 Permalink
  • FeynmanLogomaker
    5th Oct 2013 Member 0 Permalink

    Oops, wrong account. I was checking out some saves I made on an account I had a really long time ago :/

  • mniip
    6th Oct 2013 Developer 0 Permalink
    let me kick in:
    lines 8-18: wha?
    lines 23-43: did you know t.name == t['name']
    lines 38-44: why all this overcomplication, just make drawLetter() accept a table, and use the `or`

    EDIT: i have a deja vu, i recall writing this before
    Edited once by mniip. Last: 6th Oct 2013
  • FeynmanLogomaker
    6th Oct 2013 Member 0 Permalink

    Yeah, it's not the best code. Thanks for your suggestions, I will do them.