[SOLVED] Center Typewriter/Unscramble text?
Groctel
18 Dec 2016, 17:01Basically that. I'm making a pc-like interface and want some things to be centered on the screen while they get unscrambled or typewritten.
I would also like to have that feature in my main menu.
This is the menu code as of now.
PrintCentered ("Please type the option you wish to proceed with.
<br/>
<br/>
<br/>
- <b>New game</b> -
<br/>
- <b>Restore game</b> -
<br/>
<br/>
<br/>")
Line breaking just for reading comodity :p
Thank you very much!

OurJud
18 Dec 2016, 18:21You need to explain your problem better than this. It's not at all clear what you're asking here.

Groctel
18 Dec 2016, 18:43I'll try!
I want some pieces of text to be shown with the unscramble and typewriter effects. That's perfectly fine and I have no problem with those options.
My problem comes when I try to have that text centered. If I set a text to unsramble, it is always displayed at the left with no bleed. Like this:
SetFontName ("'Lucida Console', Monaco, monospace")
TextFX_Unscramble ("╔══════════════════════════════╗", 100, 1)
TextFX_Unscramble ("║·███·█·█·███·██··███·███··█·█·║", 100, 1)
TextFX_Unscramble ("║··█··███·█·█·█·█··█··███··██··║", 100, 1)
TextFX_Unscramble ("║··█··█·█·███·██··███·█·█··█·█·║", 100, 1)
TextFX_Unscramble ("╚══════════════════════════════╝", 100, 1)
As you can see, the message kind of displays a logo, but in a pc, it would make much more sense to have that logo centered on the screen. Not vertically, but horizontally.
I just realized the example code I put at the first message doesn't help much, sorry for that >-<
Anyway. What I need is a way to be able to unscramble/typewrite + center the text.
Jay Nabonne
18 Dec 2016, 21:11Try this:
section = StartNewOutputSection()
SetFontName ("'Lucida Console', Monaco, monospace")
TextFX_Unscramble ("╔══════════════════════════════╗", 100, 1)
TextFX_Unscramble ("║·███·█·█·███·██··███·███··█·█·║", 100, 1)
TextFX_Unscramble ("║··█··███·█·█·█·█··█··███··██··║", 100, 1)
TextFX_Unscramble ("║··█··█·█·███·██··███·█·█··█·█·║", 100, 1)
TextFX_Unscramble ("╚══════════════════════════════╝", 100, 1)
EndOutputSection(section)
JS.eval ("$('."+section+"').css('text-align', 'center');")

OurJud
18 Dec 2016, 21:52Yeah, that's exactly what I was about to say. I was just beaten to it, ahem.

Groctel
18 Dec 2016, 23:04My only problem is... where do I paste that? D:

OurJud
19 Dec 2016, 02:47In the same place you had your own. I presume the room in which you want the logo to be displayed.

Groctel
19 Dec 2016, 08:52In the web version (yes, I use the web client) I try to add it into the script code but the server gives me an error every time.
When I load the script in my desktop version testing file, the game just returns 'you are in a room'. What am I doing wrong?
I imagine it has something to do with where the section lines go, but I honestly have no idea :'(

Groctel
19 Dec 2016, 15:20Forget it, I was not saving the script into the actual code. It works now.
Thank you very much :D
Btw, which name do you want me to put when I credit you in my game as helpers? :p

OurJud
19 Dec 2016, 17:45I can't answer for Jay, but it's not necessary. Thank you for the gesture, though :)