001 Game Creator

001 Game Creator

View Stats:
StByStCoder Feb 10, 2016 @ 8:37pm
Change font in message box.
How I can change the font for a single word or a message? This code does not change the font of message:

SET Field("|Message Box:Text").Font = "Main Font"

MsgBox.Show("Hello.")

MsgBox.Hide
Last edited by StByStCoder; Feb 10, 2016 @ 8:40pm
< >
Showing 1-9 of 9 comments
Lee Feb 11, 2016 @ 3:12am 
It's not currently possible to change the Font of a single word in a Message Box. The only in-line formatting you can currently do is change the colour of individual words.

You can use the "Change Font" event to change the font of a particular Field though.
Last edited by Lee; Feb 11, 2016 @ 3:13am
StByStCoder Feb 11, 2016 @ 3:42pm 
Originally posted by Alomerain:
It's not currently possible to change the Font of a single word in a Message Box. The only in-line formatting you can currently do is change the colour of individual words.

You can use the "Change Font" event to change the font of a particular Field though.

Thank you for your information. But the font does not change now. I write all my actions for change a font: I click on test button, click on actor in the map, - expand events- change font- Message box- text- none- Health font. I click on message box and write 'Test'. I test the game: game font of message box has not changes, font in 'Test' message == Main Font.
What my actions are wrong?

P.S. Font can be changed by pressing the Interface- message box- text- text font. But I want to change the font in a single message. And then return Font's value == Main Font.
I am sorry for my English.
Last edited by StByStCoder; Feb 11, 2016 @ 4:06pm
Lee Feb 12, 2016 @ 2:24am 
Ah, I think I see the problem. The reason this is happening is because when the "Message Box" Interface is turned on, it resets itself. So if you change the font and then have a Message Box event, the Change Font event will be overwritten.

Here's how I got around this issue:

1) In the "Message Box" Interface Properties window, untick the option called: "Auto-Update/Reload Interface on Activate"

2) Whilst still in the Properties window, click on the "Edit Script" button to bring up the Message Box script.

3) Create a new Local Variable, by pressing the "Edit Local Variables" button in the bottom-left corner of the window and name it something like "font". Then tick the "Persistent" check box next to it.

4) Looking at the Message Box script, detach the "Start" node from the "Comparison Branch" node (by simply right-clicking the line) and then (with the Start node selected) create a "Variable Operation" event.

5) Set the "Variable" to your Local Variable you just created and then for the "Value", click on the use value button to the right of the text box, search for "font" and select "Font" underneath the "Field" tree. Then select the "Text" Field and click OK.

6) Then create a "Reset Interface" event and set the Interface to "this". Then attach this event to the "Comparison Branch" event that you detached earlier.

7) Finally, at the very end of the script add a "Change Font" event to the left node of the "MsgBox.AutoClose" Comparison Branch. Select the "Text" Field and then set the Font to your Local Variable (by clicking the use value button beside it and selecting it from the "Local Variables" tree)

With this modification, you should now be able to use the "Change Font" event, followed by a "Message Box" event in your Actor trigger and it should now properly update.
StByStCoder Feb 12, 2016 @ 9:19am 
Originally posted by Alomerain:
create a "Reset Interface" event

Thank you for your detailed reply. I did some action in the program and the font changed.
Text Script text:

LOCAL MainFont
'reset interface
SET MainFont = Field("Text").Font
SET Field("|Message Box:Text").Font = "Health Font"
MsgBox.Show("This is a Health Font")
MsgBox.Hide
SET Field("|Message Box:Text").Font = MainFont
MsgBox.Show("This is a Main Font")
MsgBox.Hide

Tell me please, can I change the size of the characters in Text Script?
And I am sorry for my English.
P.S And I bought full version (no demo) GG Maker today . :)




Last edited by StByStCoder; Feb 12, 2016 @ 9:40am
Lee Feb 13, 2016 @ 2:18am 
Textual scripting is incredibly limited. You'd be far better off using the visual scripting system. As I mentioned previously, the only in-line formatting that can currently be done is changing the colour so no, you can't change the font size of characters via scripting.

You could get around this by creating different Fonts (in the Font window) with different sizes and swapping them out whenever you wish to use a different size (using the "Change Font" event).
StByStCoder Feb 13, 2016 @ 3:12am 
I'm sorry, I wrote wrong the previous message. I would like to change the size of the script characters in the Text Script IDE.
I'm sorry for my English.
StByStCoder Feb 13, 2016 @ 3:13am 
Originally posted by Alomerain:
Textual scripting is incredibly limited. You'd be far better off using the visual scripting system. As I mentioned previously, the only in-line formatting that can currently be done is changing the colour so no, you can't change the font size of characters via scripting.

You could get around this by creating different Fonts (in the Font window) with different sizes and swapping them out whenever you wish to use a different size (using the "Change Font" event).

I'm sorry, I wrote wrong the previous message. I would like to change the size of the script characters in the Text Script IDE.
I'm sorry for my English.
Lee Feb 14, 2016 @ 3:45am 
Ah, right I see. Unfortunately there is no way to increase the text size in Textual Scripting. For all intended purposes it's considered legacy and so it doesn't have much in terms of features.
StByStCoder Feb 15, 2016 @ 12:01am 
Originally posted by Alomerain:
Ah, right I see. Unfortunately there is no way to increase the text size in Textual Scripting. For all intended purposes it's considered legacy and so it doesn't have much in terms of features.
Ok, thank you for your information.
Last edited by StByStCoder; Feb 15, 2016 @ 12:01am
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Feb 10, 2016 @ 8:37pm
Posts: 9