Skip to content

Colours and profiles definitions for the onscreen text displayer

Al'rind edited this page Jul 13, 2015 · 3 revisions

This section covers use of the extended database and two of its internal tables (these are tables defined by RME and not by the user).

The onscreen text displayer

RME provides a series of commands in order to display text on screen. These commands sometimes require the use of a profile and/or a colour. Profiles and colours are stored in the static database in order to be easily definable and updatable. Let's see how to create texts' colours and profiles.

During the game's execution (in editor mode), RME builds the table IColor and ITextProfile if they do not exist. Usually, when a table is prefixed with the letter I that means that the table is an internal one and is used by RME's system. That's in these tables that we will define new texts' colours and profiles.

Creating a colour

Firstly, let's look on the table IColor's schema:

class IColor < Static::Table
  pk string :name
  integer :red
  integer :green
  integer :blue
  integer :alpha
end

This table has five fields. The first one: :name is a sequence of characters identifying one colour from another (that's what we call a primary key); and the four other fields are integers corresponding to the value of red, green, blue and transparency (255=opaque, 0=transparent) used to define the colour. Adding a new colour is as simple as adding a new line in the file Database/tables/IColor.csv (when you will open it, you will see that some colours have already been defined), just like this:

A little gif

Through executing your project (from the editor), you will be able to see that the colours that we have previously defined are added in the list of available colours.

Creating a profile

Let's look on the table ITextProfile's schema:

class ITextProfile < Static::Table
  pk string :name
  integer :size
  string :font
  string :color_name
  boolean :italic
  boolean :bold
  boolean :outline
  string :outline_color_name
  boolean :shadow
end

As for the colour, you will only have to modify the file Database/tables/ITextProfile.csv. Here is an example:

A little gif

Do not hesitate to create as many texts' profile as you want, especially for damages !

Deleting default colours and profiles

If by any chance you came up to delete default elements in the two previous tables, you can move the two corresponding files in the directory Database/backups and restart the game. The tables will be rebuilt with default values and you will be able to copy/paste the values from the backup.

Clone this wiki locally