Difference between revisions of "Displayed Text"
(15 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Displayed text is the text spoken by a character or narration text which is not spoken by a character & can be positioned wherever you like on the screen. | + | Displayed text is the text spoken by a character or narration text which is not spoken by a character & can be positioned wherever you like on the screen. Object text, is text which can be linked to a scene object & displayed indefinitely until you remove it via the remove object text action part - object text is only (currently) valid for non-menu scenes. |
+ | Let's have a look at the '''Display text''' action part first which is found inside of the '''Character''' action part area. By default character spoken text appears above the text owner (character who the displayed text is linked to) & is aligned via the '''text alignment''' drop down menu found inside of the '''game''' properties tab. Having said that we can in fact set a custom position (absolute) via Lua Script with the '''VTextPosition''' data structure field & the registerHookFunction - see further down the page for an example. | ||
− | + | The '''Display narration text''' action part however is more geared towards narration & can be positioned on the screen wherever you like. | |
+ | {| class="ts" | ||
+ | |- | ||
+ | | ''The '''Display speaker text''' action part was renamed to '''Display narration text''' in Visionaire Studio 4.0.'' | ||
+ | |} | ||
− | |||
− | + | == Pause Tags == | |
− | + | Pause/delay methods for controlling how long the displayed text should be displayed for... | |
<syntaxhighlight> | <syntaxhighlight> | ||
Wait until left mouse button is clicked to continue <p> | Wait until left mouse button is clicked to continue <p> | ||
Continue after 2500 milliseconds (ms) <p2500ms> | Continue after 2500 milliseconds (ms) <p2500ms> | ||
− | Continue after 2.5 seconds (s) <p2.5s> | + | Continue after 2.5 seconds (s) <p2.5s> or <p2.5> -- (dropped in 4.x) |
Wait until linked speech file has finished playing <pa> | Wait until linked speech file has finished playing <pa> | ||
+ | Wait until linked speech file has finished playing (with fallback time (in ms) if media file is missing or corrupted <pa2500ms> | ||
--[[ | --[[ | ||
!important: You need to be careful that when you are using the first example <p> that you do not hide the mouse cursor | !important: You need to be careful that when you are using the first example <p> that you do not hide the mouse cursor | ||
beforehand as hide cursor action part disables all key input & commands until the cursor is shown; thus | beforehand as hide cursor action part disables all key input & commands until the cursor is shown; thus | ||
− | your game will end up stuck on the displayed text! | + | your game will end up stuck on the displayed text! -- (text can now be skipped with left click in 4.x; even if cursor is hidden). |
--]] | --]] | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | {| class="ts" | ||
+ | |- | ||
+ | | ''The <pa> fallback time tag is only available from Visionaire Studio 4.x onwards.'' | ||
+ | |- | ||
+ | | ''Seconds tags (i.e: <p2.5s> & <p2.5>) are not supported by Visionaire Studio 4.x; all the other tags are still valid.'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | == Displaying Values (integer / string) == | ||
+ | Methods for displaying "string" & integer (number) values of a specified value inside of a displayed text... | ||
+ | <syntaxhighlight> | ||
+ | I have $<v=money> in my wallet. <p2000ms> -- displays integer value of the linked value | ||
+ | My name is <vs=protagonist_name>. <p2500ms> -- displays "string" value of the linked value | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | {| class="ts" | ||
+ | |- | ||
+ | | ''The value name is case sensitive.'' | ||
+ | |} | ||
− | + | == Custom Text Position == | |
+ | You can set a custom text position vua Lua script. ''See [[RegisterHookFunction|here]], for more details.'' | ||
<syntaxhighlight> | <syntaxhighlight> | ||
-- let's create the function which sets the position of displayed text | -- let's create the function which sets the position of displayed text | ||
Line 30: | Line 56: | ||
if text:getLink(VTextOwner):getId().tableId == eCharacters then | if text:getLink(VTextOwner):getId().tableId == eCharacters then | ||
text:setValue(VTextPosition, {x=960, y=100}) | text:setValue(VTextPosition, {x=960, y=100}) | ||
+ | return true | ||
end | end | ||
end | end | ||
Line 35: | Line 62: | ||
-- let's create the event listener for handling position of displayed text | -- let's create the event listener for handling position of displayed text | ||
registerHookFunction("setTextPosition", "setTextPosHook") | registerHookFunction("setTextPosition", "setTextPosHook") | ||
− | </syntaxhighlight> | + | </syntaxhighlight>{{toc}} |
Latest revision as of 14:31, 24 March 2015
Displayed text is the text spoken by a character or narration text which is not spoken by a character & can be positioned wherever you like on the screen. Object text, is text which can be linked to a scene object & displayed indefinitely until you remove it via the remove object text action part - object text is only (currently) valid for non-menu scenes.
Let's have a look at the Display text action part first which is found inside of the Character action part area. By default character spoken text appears above the text owner (character who the displayed text is linked to) & is aligned via the text alignment drop down menu found inside of the game properties tab. Having said that we can in fact set a custom position (absolute) via Lua Script with the VTextPosition data structure field & the registerHookFunction - see further down the page for an example.
The Display narration text action part however is more geared towards narration & can be positioned on the screen wherever you like.
The Display speaker text action part was renamed to Display narration text in Visionaire Studio 4.0. |
Pause Tags
Pause/delay methods for controlling how long the displayed text should be displayed for...
Wait until left mouse button is clicked to continue <p>
Continue after 2500 milliseconds (ms) <p2500ms>
Continue after 2.5 seconds (s) <p2.5s> or <p2.5> -- (dropped in 4.x)
Wait until linked speech file has finished playing <pa>
Wait until linked speech file has finished playing (with fallback time (in ms) if media file is missing or corrupted <pa2500ms>
--[[
!important: You need to be careful that when you are using the first example <p> that you do not hide the mouse cursor
beforehand as hide cursor action part disables all key input & commands until the cursor is shown; thus
your game will end up stuck on the displayed text! -- (text can now be skipped with left click in 4.x; even if cursor is hidden).
--]]
The <pa> fallback time tag is only available from Visionaire Studio 4.x onwards. |
Seconds tags (i.e: <p2.5s> & <p2.5>) are not supported by Visionaire Studio 4.x; all the other tags are still valid. |
Displaying Values (integer / string)
Methods for displaying "string" & integer (number) values of a specified value inside of a displayed text...
I have $<v=money> in my wallet. <p2000ms> -- displays integer value of the linked value
My name is <vs=protagonist_name>. <p2500ms> -- displays "string" value of the linked value
The value name is case sensitive. |
Custom Text Position
You can set a custom text position vua Lua script. See here, for more details.
-- let's create the function which sets the position of displayed text
function setTextPosHook(text)
-- if text owner is a character then...
if text:getLink(VTextOwner):getId().tableId == eCharacters then
text:setValue(VTextPosition, {x=960, y=100})
return true
end
end
-- let's create the event listener for handling position of displayed text
registerHookFunction("setTextPosition", "setTextPosHook")