Author Topic: Char input sneak peek  (Read 1683 times)

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: Char input sneak peek
« Reply #15 on: October 18, 2016, 10:33:52 pm »
What's weird in your last post is that the box is drawn bellow entities, otherwize there is nothing more to say except it's a nice feature

@MetalZelda
I grabbed the black tile and made the black box for the gif. The purple text would be hard to see and I did not want to make a black image.

Quote
It is good to see that you have progressed a lot with this script. Your work looks promising and may be useful to other people.

@Diarandor
It was very tricky for the first 10 minutes with this script, but due to that I can add more features.  Without "string.reverse" the text would be backwards and I can make the text look like a slash or a diagonal line. These features might be useful for some puzzles or looped animation and were done by accident.

EX:
zefk
kfez

 z
  e
    f
     k
       i
        s
          g
            r
             a
               n
                 d

This could be made to pass values too, but that is a bit tricky to make. I would probably use this char  ``````. That would be for 6 places. 999,999. I would probably do that if I make this into a dialog box.
« Last Edit: October 19, 2016, 12:56:44 am by Zefk »

Neovyse

  • Administrator
  • Jr. Member
  • *****
  • Posts: 85
    • View Profile
Re: Char input sneak peek
« Reply #16 on: October 19, 2016, 12:53:50 am »
One thing the moderator should do is, add a new subforum where there would be only scripts for Solarus

Actually it already exists: isn't it the Development subforum ?  :)

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: Char input sneak peek
« Reply #17 on: October 19, 2016, 12:55:40 am »
I added the diagonal line, reverse text feature, and a third line. The gif proves that special characters can be used too. !#@

I mentioned this before, but any images can be used.

EX:
Apple.png can appear for the 'a' and/or orange.png can appear for 'o'. Names will have to be changes in the script or a.png can be an apple image.


« Last Edit: October 19, 2016, 01:10:21 am by Zefk »

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: Char input sneak peek
« Reply #18 on: October 19, 2016, 02:33:40 am »
One thing the moderator should do is, add a new subforum where there would be only scripts for Solarus

Actually it already exists: isn't it the Development subforum ?  :)

@Neovyse
I believe the description of the Development subforum is examples of scripts, help questions, tips, etc. It is not a place for "only" working scripts submissions for Solarus v1.x.x, but I honestly do not mind either way. I post my scripts here when finished.

As this is a scripting development 'project.' I am just getting feedback here until the script is good enough to release. I will actually release it in one script and 3 separate scripts because maybe they only want to use one part of the naming process (Nameplate, input text, and picking names.) or so they can make it compatible with their project.

All that is left for me to do is add cancel, add comments/clean up, and package this project.

MetalZelda

  • Sr. Member
  • ****
  • Posts: 499
    • View Profile
Re: Char input sneak peek
« Reply #19 on: October 19, 2016, 12:35:10 pm »
One thing the moderator should do is, add a new subforum where there would be only scripts for Solarus

Actually it already exists: isn't it the Development subforum ?  :)

Yes but the development subforum is mostly about the API scripts, there is user-made scripts, but they are a bit dispatched over the whole subforum, between some help threads.
A "script" subforum should be better, as it would contain scripts for solarus, and only scripts.
Plus, it could be useful to add in the "help" section of the Quest Editor a "Script" box which will redirect to this subforum

I don't know what do you think


Neovyse

  • Administrator
  • Jr. Member
  • *****
  • Posts: 85
    • View Profile
Re: Char input sneak peek
« Reply #20 on: October 20, 2016, 02:13:54 pm »
I agree we should maybe create sort of a "library" of user scripts, now that Solarus have more users!

Christopho

  • Administrator
  • Hero Member
  • *****
  • Posts: 1018
    • View Profile
Re: Char input sneak peek
« Reply #21 on: October 20, 2016, 02:24:51 pm »
Ok I just created a new forum section "Your scripts".

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: Char input sneak peek
« Reply #22 on: October 20, 2016, 09:21:07 pm »
I will post my previous scripts there, once I shorten them with arrays and add loading with require.

llamazing

  • Jr. Member
  • **
  • Posts: 71
    • View Profile
Re: Char input sneak peek
« Reply #23 on: October 21, 2016, 08:15:00 am »
I haven't seen your script, but you should avoid using string.reverse() for text displayed on-screen because it is not compatible with multi-byte utf-8 strings (used in non-english text). If you really need to reverse a string, I guess you could write a custom reverse function that is utf-8 friendly.

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: Char input sneak peek
« Reply #24 on: October 21, 2016, 10:45:59 am »
I think I can do it without string.reverse().

Code: Lua
  1. local test = "test"
  2. local test_split = {}
  3.  
  4. for char in string.gmatch(test, "%w") do
  5.   table.insert(test_split, char)
  6. end

It does the opposite of my previous code. (Which is normal order.) I use reverse to make the text not reversed because they are reverse to begin with. Not sure if it makes a difference, but any alphabetical character can refer to any png image font character.

Zefk

  • Sr. Member
  • ****
  • Posts: 492
  • Just helping Solarus
    • View Profile
    • Zelzec Business
Re: Char input sneak peek
« Reply #25 on: October 24, 2016, 03:02:10 am »
I decided to extend this script a little further. I will be adding a sol.text_surface.create option. That is for people that want to use font packages. It will actually be very little change in the scripts.