Changing your Game Font
Changing your game's font can bring a lot of personality to your game. It is important to note that there are four areas where you might want to change your font for consistency.
There are many ways you can do this.
Using the Script Editor
If you are feeling courageous, we can use the Script Editor to change the font.
###
# CONSTANTS FOR FONT SIZE
###
class DesktopUIConstants
@TEXT_SIZE_SMALL = 20
@TEXT_SIZE_MESSAGE = 24
@TEXT_SIZE_MESSAGE_NAME = 25
gs.DesktopUIConstants = DesktopUIConstants
gs.UIConstants = DesktopUIConstants
###
# NAME BOX
###
ui.UIManager.styles.messageBoxNameText = {
"font": {
"name": "Times New Roman",
"size": gs.UIConstants.TEXT_SIZE_MESSAGE_NAME,
"smallCaps": false,
"italic": false,
"color": [59, 59, 59, 255],
}
}
###
# ADV MODE
###
ui.UIManager.styles.advMessageText = {
"font": {
"name": "Times New Roman",
"size": gs.UIConstants.TEXT_SIZE_MESSAGE,
"smallCaps": false,
"italic": false,
"color": [59, 59, 59, 255],
}
}
###
# NVL MODE
###
ui.UIManager.styles.nvlMessageText = {
"font": {
"name": "Times New Roman",
"size": gs.UIConstants.TEXT_SIZE_MESSAGE,
"smallCaps": false,
"italic": false,
"color": [59, 59, 59, 255],
}
}
###
# CUSTOM MESSAGE
###
ui.UIManager.styles.customMessageText = {
"font": {
"name": "Times New Roman",
"size": gs.UIConstants.TEXT_SIZE_MESSAGE,
"smallCaps": false,
"italic": false,
"color": [59, 59, 59, 255],
}
}
###
# BACKLOG, ETC.
###
ui.UIManager.styles.messageText = {
"font": {
"name": "Times New Roman",
"size": gs.UIConstants.TEXT_SIZE_MESSAGE,
"smallCaps": false,
"italic": false,
}
}
###
# Defines the font used for the name-column of the message backlog.
###
ui.UIManager.styles.backlogNameText = {
"font": {
"name": "Times New Roman",
"size": gs.UIConstants.TEXT_SIZE_MESSAGE_NAME,
"smallCaps": false,
"italic": false,
"border": true,
"borderSize": 4 }
}
Here's a quick breakdown:
You can also add your own properties. For example, adding bold to messages would look like this:
###
# ADV MODE
###
ui.UIManager.styles.advMessageText = {
"font": {
"name": "Times New Roman",
"size": gs.UIConstants.TEXT_SIZE_MESSAGE,
"smallCaps": false,
"italic": false,
"bold": true,
"color": [59, 59, 59, 255],
}
}
Don't be afraid to play around with it! The editor will tell you if an error occurs. So you don't have to worry if you might break your project.
Now that we have given you ways to change your game font, have fun!