Text

ContentObjectsText


perron-luidspreker.jpg

Setup


Attribute Description Comment
ID A unique ID, which is used by Rocrail to address the element. This ID is usually assigned by Rocrail.
Text This attribute stores the string, which should be displayed in the track plan and can be changed here.
Image you can define the path to an image using this button, if you like to see an image in your trackplan instead of a simple text
Tip Tooltip for this element.
Point size You can change with this attribute the font size of the text. 0 (default) means the standard value of the operating system.
Color Forground color.
Background Background color. Is only shown if the attribute transparent is not set.
Orientation Default is horizontal.



The tab 'Location' is described in chapter Track diagram elements. The attribute cx is quite important for the handling of text. If a string is not completely displayed in the plan, you should increase this value until the whole string is shown in the track plan.


Display an image


If the text ends with .png the text object will try to find the matching image in the imagepath defined in the rocgui.ini.


Actions

An action can be used to let the text be spoken by a program like espeak.
This action will only be executed when this text object is update by a Text action, see “Dynamic text”.


Dynamic content

Revision 1733.

If Text actions are defined for block events the text can be dynamically changed.
This event will trigger executing actions defined for this text object.

Example of a Text action which can be connected to a block:


Variables

Build in

Loco
%lcid% Loco ID
%lcimg% Loco image
%lcdest% Loco destination
%lcdesc% Loco description
%lcnr% Loco number
%lcdir% Loco direction: “fwd”/“rev”
%lcplacing% Loco placing: “norm”/“swap”
Schedule
%lcscid% Schedule ID
%lcscbk% Schedule block ID
%lcscbkloc% Schedule block location
%lcschour% Schedule departure hour
%lcscmin% Schedule departure minute
%lcscnextbk% Schedule next block ID
%lcscnextbkloc% Schedule next block location
%lcscprevbk% Schedule previous block ID
%lcscprevbkloc% Schedule previous block location
Block
%bkid% Block ID
%bkloc% Block location name
%bkdesc% Block description
%frombkid% Coming from block
%frombkloc% From block location name
%frombkdesc% Coming from block description


Environment

All defined environment variables can also be used:
“Good morning %USER%.”
(consider in Windows: %USERNAME%)

will be evaluated like this:
“Good morning rob.”

Speak to me

loudspeaker.jpg

espeak

a Linux script with the content:

mplayer jingle.wav;
espeak -vde+f2 " $* ";

will play a jingle before the dynamic text is spoken.


A Windows batch could look like this:

c:\playwav ns.wav
c:\espeak -vnl+m3 %1%
exit

or:

sndrec32 /play /close /embedding c:\sound\gong.wav
C:\Programme\eSpeak\command_line\espeak.exe -v de+f2 %* 


Demo

Downloads

Related topics


Personal Tools