Text formatting

From QuestWiki
Jump to: navigation, search

Up until now, our Quest game has been entirely plain text. In this section, we'll look at jazzing things up a bit by using text formatting, and including pictures, sounds and video.

Contents

Setting the Default Font and Colours

To change the default font and colours used throughout your game, select "game" from the tree and go to the Display tab.

Here you can set the initial font, foreground, background and hyperlink colours.

Changing Fonts and Colours during the Game

You can also change the font and colours while the game is in progress. You can do this using script commands. The commands are all in the "Output" category - you can change the foreground and background colour, and also the font and font size.

Bold, Italic, Underline

You can use HTML-style formatting to set bold, italic and underline. For example, when printing a message, you can type this:

This text is <b>bold</b>. This text is <i>italic</i>. This text is <u>underlined</u>.

This will output:

This text is bold. This text is italic. This text is underlined.

You can also temporarily override colour using a "color" tag, for example:

This text is the current foreground colour, but <color color="red">this is red</color>.

Inserting Pictures

You can show a picture using the "Show a picture" command. Let's make our "kitchen" room show a picture of a kitchen when we enter it.

First we need to find a picture of a kitchen.

Now select the "kitchen" room from the tree. Click the Scripts tab, and go to the "After entering the room" script. Add a "Show picture" command, and browse for your kitchen photo. The picture will be automatically copied to the same folder as your game file.

Now launch the game and go to the kitchen to verify that the picture is displayed with the room description.

Static Picture Frame

If you want to use a picture for each room, creating a script for each one is a pain, and more importantly, you probably don't want the picture to scroll in-line with the rest of the game text.

Instead, you can use the static picture frame option. This provides a static area at the top of the screen for your picture, while the text scrolls underneath. You can change the picture using a script command, and you can also give each room its own picture.

If you want to have a picture per room, but some of the rooms will have no picture, you should turn on the "Clear frame if room has no picture" option. Otherwise, if you go to a room with no picture, the previous picture will still be shown in the frame.

If you click on any room and go to the "Room" tab, you'll see a "Room picture" editor at the top. Here you can browse for a picture file, and it will be copied to your game folder. You can also choose existing picture files from the drop-down.

You can also change the frame picture using a script, with the "Set frame picture" command.

Sound and Video

You can play a sound in a script using the "Play sound" command. Quest supports both WAV and MP3 files, but I recommend you use MP3 files as much as possible because these are more widely supported by web browsers on different platforms.

You can choose "Wait for sound to finish before continuing" if you want to run the remaining script only after the sound has finished. This is useful for intro sequences, or letting some speech finish before moving the player to a different room, for example.

The "loop" option will cause the sound to continue playing until the "Stop sound" command is run. Note that Quest won't let you use both the "wait" and "loop" options at the same time - hopefully for obvious reasons.

You can also embed video in your game via the "Scripts" tab. The video will appear in-line with the game text. You can embed videos from YouTube or Vimeo. You will need to specify the video id - you can usually see this easily in the URL of a video on the YouTube or Vimeo sites. For example you can find Jason Scott, Director of GET LAMP, on GoogleTechTalks Channel. the Youtube ID is "LRhbcDzbGSU."

You can also find script commands to print an email or web address hyperlink.

Tutorial

Beginners

  1. Introduction
  2. Creating a simple game
  3. Interacting with objects

Intermediate

  1. Using scripts
  2. Custom attributes
  3. Custom commands
  4. More things to do with objects
  5. Using containers
  6. Moving objects during the game

Advanced

  1. Using timers and turn scripts
  2. Changing templates
  3. Text formatting
  4. Using lockable exits
  5. Using lockable containers
  6. Using walkthroughs
  7. Multiple choices - using a "switch" script
  8. Debugging your game
  9. Releasing your game

Elite

  1. Creating functions which return a value
  2. Using inherited types
  3. Using libraries
  4. Using Javascript
Personal tools
Namespaces
Variants
Actions
Navigation
Quest Documentation
Toolbox