[SOLVED] Center Typewriter/Unscramble text?

Basically 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!


You need to explain your problem better than this. It's not at all clear what you're asking here.


I'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.


Try 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');")

Yeah, that's exactly what I was about to say. I was just beaten to it, ahem.


My only problem is... where do I paste that? D:


In the same place you had your own. I presume the room in which you want the logo to be displayed.


In 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 :'(


Forget 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


I can't answer for Jay, but it's not necessary. Thank you for the gesture, though :)


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums