Text Pointers
Text pointers are floating labels with optional attached arrows and close buttons that point to items on screen, drawing the player's attention there. They are primarily intended for use in tutorial scripts. They have been extended to show streaming text in cutscenes in battle, using cutscene:show_custom_cutscene_subtitle
.
Text pointer objects are created with text_pointer:new
, configured, and then visually shown with text_pointer:show
. Once shown, a text pointer may be hidden again by calling text_pointer:hide
. Alternatively, the core object provides the function core:hide_all_text_pointers
to hide all visible text pointers.
A great many configuration options exist for text pointers. To simplify configuration as much as possible a number of syles have been provided, each of which sets a range of configuration options automatically. Styles can be set with text_pointer:set_style
.
Loaded in Battle | |
Loaded in Campaign | |
Loaded in Frontend |
-
text_pointer:new(string
name, [string
display mode], [number
length], [number
x position], [number
y position])
-
Creates a text_pointer object pointing to a supplied position on the screen.
Parameters:
1
string
Name for the text pointer. Must be unique amongst text pointers.
2
string
optional, default value="bottom"
Pointer display mode. Determines in what direction the arrow pointer appears relative to the pointer label. Supported values:
- "top", the pointer line is drawn above the text label, pointing upwards.
- "bottom", the pointer line is drawn below the text label, pointing downwards.
- "left", the pointer line is drawn to the left of the text label, pointing to the left.
- "right", the pointer line is drawn to the right of the text label, pointing to the right.
- "worldspace", a special mode, whereby the text pointer appears in 3D space rather than 2D. In this case the pointer line appears below the text label.
- "subtitle", a special mode, whereby the text pointer appears and behaves as a cutscene subtitle in the lower cinematic bar. x/y positions are disregarded in this case.
3
number
optional, default value=0
Length of the attached arrow pointer and line. Can be zero.
4
number
optional, default value=0
X position. This is either the absolute position on-screen, or the position in 3D space if the pointer display mode is set to worldspace.
5
number
optional, default value=0
Y position. This is either the absolute position on-screen, or the position in 3D space if the pointer display mode is set to worldspace.
Returns:
text_pointer
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 86
-
text_pointer:new_from_component(
name
string,
display mode
[string],
length
[number],
ui component
object,
x proportion
[number],
y proportion
[number]
) -
Creates a text_pointer object pointing to a supplied uicomponent. The uicomponent may either be supplied directly or as a function that returns a uicomponent.
Parameters:
1
string
Name for the text pointer. Must be unique amongst text pointers.
2
string
optional, default value="bottom"
Pointer display mode. Determines in what direction the arrow pointer appears relative to the pointer label. Supported values:
- "top", the pointer line is drawn above the text label, pointing upwards.
- "bottom", the pointer line is drawn below the text label, pointing downwards.
- "left", the pointer line is drawn to the left of the text label, pointing to the left.
- "right", the pointer line is drawn to the right of the text label, pointing to the right.
- "worldspace", a special mode, whereby the text pointer appears in 3D space rather than 2D. In this case the pointer line appears below the text label.
- "subtitle", a special mode, whereby the text pointer appears and behaves as a cutscene subtitle in the lower cinematic bar. x/y positions are disregarded in this case.
3
number
optional, default value=0
Length of the attached arrow pointer and line. Can be zero.
4
object
UI component to point at. This can be supplied as either a uicomponent or a function that returns a uicomponent. By default the pointer will point to the middle of the component - use the offset parameters to change this.
5
number
optional, default value=0.5
Unary x proportion specifying a pointed position relative to the dimensions of the specified component. Supply zero to point at the left edge of the component, one to point at the right edge of the component, or 0.5 to point at the middle of the component, for example. Values less than zero or greater than one are valid.
6
number
optional, default value=0.5
Unary y proportion specifying a pointed position relative to the dimensions of the specified component. Supply zero to point at the top edge of the component, one to point at the bottom edge of the component, or 0.5 to point at the middle of the component, for example. Values less than zero or greater than one are valid.
Returns:
text_pointer
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 125
-
text_pointer:new_from_position_offset_to_text_pointer(
name
string,
text pointer
text_pointer,
x offset
number,
y offset
number
) -
Creates a text_pointer object with a position relative to another text pointer. This can be used to make text pointers appear in a sequence on the screen.
Parameters:
1
string
Name for the text pointer. Must be unique amongst text pointers.
2
text_pointer
Text pointer object to display relative to.
3
number
x offset in pixels from the other text pointer. This takes into account the other text pointer's size, so the two text pointers cannot overlap.
Supplying a value of 10 would mean a gap of 10 pixels between the two text pointers, with this text pointer on the right of the other, while a value of -10 would mean a gap of 10 pixels with this text pointer on the left.
4
number
y offset in pixels from the other text pointer. This takes into account the other text pointer's size, so the two text pointers cannot overlap.
Supplying a value of 10 would mean a gap of 10 pixels between the two text pointers, with this text pointer below the other (as a higher value of y means a position further down the screen), while a value of -10 would mean a gap of 10 pixels with this text pointer above the other.
Returns:
text_pointer
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 202
Once an text_pointer
object has been created with text_pointer:new
, functions on it may be called in the form showed below.
Example - Specification:
<text_pointer_object>:<function_name>(<args>)
Example - Creation and Usage:
local tp_test = text_pointer:new(
"test_pointer",
400,
300
)
tp_test:set_panel_width(400) -- calling a function on the object once created
-
text_pointer:set_layout_path(string
path)
-
Sets the path to the folder that contains the component layout file. Default value is "UI/Common UI/".
Parameters:
1
string
path
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 352
-
text_pointer:set_layout(string
path)
-
Sets the name of the layout to use for this text pointer. Default value is "text_pointer_text_only".
Parameters:
1
string
path
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 365
-
text_pointer:get_text_label()
-
Returns the text label uicomponent
Returns:
uicomponent
text label
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 390
-
text_pointer:set_pointer_width(number
pointer width)
-
Sets the width of the pointer line. Default width is 5 pixels.
Parameters:
1
number
pointer width
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 398
-
text_pointer:set_panel_width(number
panel width, [boolean
shrink horizontally])
-
Sets the width of the text panel on-screen. The default width is set by the component layout.
Parameters:
1
number
Width of panel on-screen in pixels.
2
boolean
optional, default value=false
Shrink text horizontally if on one line.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 411
-
text_pointer:set_panel_width_to_screen(number
difference, [boolean
shrink horizontally])
-
Sets the width of the text panel on-screen to be the screen width minus a supplied numeric value.
Parameters:
1
number
Width of panel on-screen will be the screen width minus this value, in pixels.
2
boolean
optional, default value=false
Shrink text horizontally if on one line.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 426
-
text_pointer:set_worldspace_display_height(number
display height)
-
Sets the height of the terrain at the pointer position. This only needs to be set if the pointer is displaying in worldspace. The script has no way of determining the height of the terrain at a position in worldspace, so it must be supplied here.
Without setting a height, a worldspace pointer will appear pointing to a height of 0, which will likely be beneath the terrain being pointed at.Parameters:
1
number
display height
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 441
-
text_pointer:set_label_offset(number
x offset, number
y offset)
-
Without setting a label offset, the text label with be centred to the position being pointed at e.g. centred directly above it if the display mode is set to "bottom", centred to the left if the display mode is set to "right" etc. Set a label offset to move the label relative to this position.
Parameters:
1
number
x offset
2
number
y offset
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 455
-
text_pointer:set_show_pointer_end_without_line(
show line end without lineboolean
)
-
Sets whether the line end should be drawn without the line.
Parameters:
1
show line end without line
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 475
-
text_pointer:set_priority(number
priority)
-
Sets the component priority of the text pointer. This determines what components the text pointer is drawn on top of, and what components it is drawn underneath.
Parameters:
1
number
priority
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 501
-
text_pointer:set_topmost([boolean
topmost])
-
Sets the text pointer components to be topmost in the UI heirarchy.
Parameters:
1
boolean
optional, default value=true
topmost
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 514
-
text_pointer:set_should_pulse([boolean
pulse], [number
pulse strength])
-
Sets the text pointer to pulse-highlight when it shows.
Parameters:
1
boolean
optional, default value=true
Set to
true
to enable pulsing.2
number
optional, default value=nil
Pulse strength override. Supply a positive number here to modify the strength of the pulse. Default value is 5.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 541
-
text_pointer:set_stream_by_char(boolean
should stream, [number
stream duration])
-
Sets the text pointer to stream its text, and optionally sets the duration over which the text is to be streamed.
Parameters:
1
boolean
should stream
2
number
optional, default value=nil
stream duration
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 576
-
text_pointer:set_stream_duration(number
stream duration)
-
Sets just the duration over which the text is to be streamed.
Parameters:
1
number
stream duration
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 598
-
text_pointer:set_panel_show_animation(string
animation name)
-
Sets a different panel show animation. Any animation set here must be present on the panel component in the text pointer layout. Default is "show".
Parameters:
1
string
animation name
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 624
-
text_pointer:set_panel_hide_animation(string
animation name)
-
Sets a different panel hide animation. Any animation set here must be present on the panel component in the text pointer layout. Default is "hide".
Parameters:
1
string
animation name
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 637
-
text_pointer:set_text_show_animation(string
animation name)
-
Sets a text show animation. Any animation set here must be present on the line component in the text pointer layout.
Parameters:
1
string
animation name
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 650
-
text_pointer:set_text_hide_animation(string
animation name)
-
Sets a text hide animation. Any animation set here must be present on the line component in the text pointer layout.
Parameters:
1
string
animation name
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 663
-
text_pointer:set_panel_state_override(string
state name)
-
Sets a different state for the text pointer panel. Any state set here must be present on the
panel
component in the text pointer layout.Parameters:
1
string
state name
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 692
-
text_pointer:set_text_state_override(string
state name)
-
Sets a different state for each line of text pointer panel. Any state set here must be present on the
line
component in the text pointer layout.Parameters:
1
string
state name
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 705
-
text_pointer:set_line_end_state_override(string
state name)
-
Sets a different state for the line end uicomponent. Any state set here must be present on the
line_end
component in thetext_pointer_line_parent
layout.Parameters:
1
string
state name
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 718
-
text_pointer:set_show_close_button([boolean
show button])
-
Shows a close button on the text pointer. By default a close button is not shown.
Parameters:
1
boolean
optional, default value=true
show button
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 743
-
text_pointer:set_hide_on_close_button_clicked([boolean
close on click])
-
Hides the text pointer when the close button is clicked. By default, this is enabled, so the panel closes when the button is clicked.
Parameters:
1
boolean
optional, default value=true
close on click
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 755
-
text_pointer:set_close_button_callback(function
callback, [number
delay])
-
Set a callback to call when the close button is clicked. An optional delay may also be set. Calling this also sets the close button to show.
A callback set using this function will not be called if the text pointer is hidden by external script - usetext_pointer:set_hide_callback
to set a callback that would be called in this case.Parameters:
1
function
Callback
2
number
optional, default value=0
Delay before calling callback, in s (campaign) or ms (battle/frontend)
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 767
-
text_pointer:set_hide_callback(function
callback, [number
delay], [boolean
show close button])
-
Set a callback to call when the text pointer is hidden. An optional delay may also be set. A further optional flag sets the close button to show.
Parameters:
1
function
Callback
2
number
optional, default value=0
Delay before calling callback, in s (campaign) or ms (battle/frontend)
3
boolean
optional, default value=false
Sets the close button to show on the text pointer.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 790
-
text_pointer:set_close_button_component(string
component name)
-
Overrides the component to use as the close button, by name.
Parameters:
1
string
component name
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 813
-
text_pointer:set_highlight_close_button(
Period the text pointer should wait after being shown before the button highlight begins. This is specified in s in campaign
[delay,]
) -
Instructs the text pointer to highlight the close button when it shows, with an optional delay between the time of showing and the time the close button is highlighted. Immediately highlights the close button if the text pointer is already showing.
Parameters:
1
delay,
optional, default value=0
ms in battle or the frontend.
This is disregarded if the text pointer is already showing at the time this function is called.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 826
-
text_pointer:set_position_as_subtitle([position
as subtitle])
-
Sets the text pointer to position itself/behave as a cutscene subtitle, in the lower cinematic bar. This is akin to setting the pointer display mode to "subtitle" in
text_pointer:new
.Parameters:
1
position
optional, default value=true
as subtitle
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 863
-
text_pointer:add_component_text(string
component name, string
localised text, [exempt
from streaming])
-
Sets the text displayed by a specified child uicomponent of the text pointer to a localised value. Use this method to show customised text on the text pointer.
Parameters:
1
string
Name of text component on the text pointer.
2
string
Full database key of localised text, in the form [table]_[localised_field]_[record_key].
3
exempt
optional, default value=false
Exempts this text from being streamed, if the text pointer is set to stream text.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 886
-
text_pointer:set_show_callback(
callbackfunction
)
-
Sets a callback to call when the text pointer is shown with
text_pointer:show
.Parameters:
1
callback
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 919
-
text_pointer:show([force
display])
-
Makes the text pointer visible.
Parameters:
1
force
optional, default value=false
Forces the text pointer to display. This flag is only considered if the text pointer has been set to behave as a subtitle with
text_pointer:set_position_as_subtitle
, and if set totrue
causes the text pointer to override the player's subtitles preferences.Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 941
-
text_pointer:hide([hide
immediately], [suppress
event])
-
Hides the text pointer. Supply
true
as a single argument to hide it immediately and prevent it from animating.Parameters:
1
hide
optional, default value=false
Hide the text pointer immediately without any animation.
2
suppress
optional, default value=false
Suppress the scripted event that triggers - this is for internal use.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 1685
-
text_pointer:is_showing()
-
Returns whether the text pointer is currently showing.
Returns:
boolean
is showing
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 1802
-
text_pointer:has_ever_been_shown()
-
Returns whether the text pointer has ever been shown.
Returns:
boolean
ever shown
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 1810
-
text_pointer:set_style(string
style, ...
additional args)
-
Sets the style of this text pointer. Setting a style automatically sets a range of configuration options common to that style - inspect the script function to find out what exactly gets set or to add more styles.
Multiple styles may be set on a given text pointer if the configuration options do not overlap (if they do then the later settings will overwrite the earlier settings).
Currently-supported styles are:
title_and_text
Sets the layout of the text pointer to "text_pointer_title_and_text". When setting this style the calling script must also supply two strings specifying the text db key of the title and the text to display. text_only
Sets the layout of the text pointer to "text_pointer_text_only". When setting this style the calling script must also supply a string specifying the text db key of the text to display. topmost
Sets the pointer to be topmost and with a component priority of 1500. semitransparent
Sets the "topmost" style and the panel state to "semitransparent". semitransparent_highlight
Sets the "semitransparent" style and sets the close button to highlight two seconds after it is shown. The text pointer will not close when the close button is clicked, however. semitransparent_highlight_dont_close
Sets the "semitransparent" style and sets the close button to highlight two seconds after it is shown. The text pointer will close when the close button is clicked. subtitle_with_frame
Sets the pointer into subtitle mode with a frame. active
Sets the "topmost" style, and sets the panel into the appropriate visual style for the active text pointer interface. Parameters:
1
string
style
2
...
additional args
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers.lua, line 1825
Active Text Pointers
Active pointers are a particular style of text_pointer
, declared as a separate class with a cut-down interface. Visually, an active pointer appears as a text box with a close button and an enlarged pointer arrow with no connecting line. The pointer arrow appears in one of the four corners of the panel.
Active pointers are always associated with a uicomponent
at which they visually point. While showing, the active pointer repeatedly polls the properties of this uicomponent
. Should the uicomponent move on-screen, become invisible, or be destroyed, the active pointer will automatically dismiss itself. From an implementation perspective active pointers are intended to be relatively 'fire and forget', requiring a minimum of manual setup in script.
An active pointer will automatically immediately hide itself if any parent/ancestor of it, back to the ui root, is seen to play an animation called "hide". This generally occurs when the host panel (e.g. diplomacy panel) is closing.
Once declared, an active pointer may be shown directly with active_pointer:show
. Alternatively, active_pointer:show_when_ready
may be used to show the pointer, which waits until the target uicomponent has stopped moving and become visible before the pointer is shown. active_pointer:show_when_ready
may optionally take a delay value, which imposes a grace period before the text pointer is shown, and a timeout period after which the function will stop trying to show the pointer. Default values for both of these can be set on the active pointer with active_pointer:set_default_delay
and active_pointer:set_default_timeout
.
The active pointer interface also provides functionality to allow the pointer itself to manage being shown. active_pointer:show_on_event
may be used to specify a script event and condition on which the active pointer should attempt to display. Furthermore, active_pointer:wait_for_active_pointer
allows this active pointer to be enqueued behind another, so that the foreign active pointer must be shown before this one will attempt to display. One active pointer can wait for multiple other active pointers, which may themselves wait upon other active pointers and so-on.
By default, active pointers store a record when they are displayed in the advice history, and will not display if that record is present when active_pointer:show
is called again. This behaviour, which is enabled by default, requires that the active pointer name is unique amongst active pointers, as the name of the advice history flag is derived from the pointer name.
This functionality can be disabled when calling active_pointer:new
by setting the suppress-record boolean argument to true
. When this is set to false
the active pointer need not have a unique name, but advanced functionality like active_pointer:show_on_event
and active_pointer:wait_for_active_pointer
will not be available.
-
active_pointer:new(
name
string
,
orientation
string
,
uicomponent specifier
uicomponent
/function
,
text key
string
,
x proportion
[number
],
y proportion
[number
],
width
[number
],
suppress record
[boolean
]
) -
Creates and returns a new active text pointer object.
Parameters:
1
Name for this text pointer. If this pointer is storing a record in the advice history (which is the default behaviour, and must be opted-out of by setting this suppress record in advice argument to
true
on this function) then the supplied name must be unique.2
Orientation of the pointer arrow that is drawn. Supported values are
"topleft"
,"topright"
,"bottomleft"
and"bottomright"
.3
Specifier of uicomponent to point at. This can either be a
uicomponent
object or afunction
that returns a uicomponent. It's strongly recommended that if the text pointer is not being displayed immediately after being created that a function is used.4
Localised text key to display, in
[table]_[field]_[key]
format.5
optional, default value=0.5
Unary x proportion specifying a pointed position relative to the dimensions of the specified component. Supply
0
to point at the left edge of the component,1
to point at the right edge of the component, or 0.5 to point at the middle of the component, for example. Values less than zero or greater than one are valid.6
optional, default value=0.5
Unary y proportion specifying a pointed position relative to the dimensions of the specified component. Supply
0
to point at the top edge of the component,1
to point at the bottom edge of the component, or0.5
to point at the middle of the component, for example. Values less than zero or greater than one are valid.7
optional, default value=250
Width of the text pointer panel in pixels.
8
optional, default value=false
Sets this active pointer to not record a record of whether it's been triggered in advice history. If this is set to
true
then the active pointer is not registered with the script core, and it doesn't need to have a unique name. However, the active pointer will not be able to automatically listen for events.Returns:
active text pointeractive_pointer
defined in ../working_data/script/_lib/lib_text_pointers_active.lua, line 108
Once a active_pointer
object has been created with active_pointer:new
, functions on it may be called in the form showed below. Active text pointers inherit from text pointers, so all functions provided by the text_pointer
interface may be called on a active_pointer.
Example - Specification:
<text_pointer_object>:<function_name>(<args>)
Example - Creation and Usage:
local ap_example = active_pointer:new(
"example",
"bottomright",
"ui_text_replacements_localised_text_example_text_pointer_str",
function()
-- function that should return a uicomponent
return find_uicomponent(core:get_ui_root(), "diplomacy_dropdown", "main_button_bar", "menu_buttons", "button_quick_deal");
end,
-- point at top-right of uicomponent
0.25,
0.75
)
-- calling a function on the object once created
ap_example:show_when_ready()
-
active_pointer:set_default_delay(
delaynumber
)
-
Sets a default delay period for this active pointer, which is the period between when
active_pointer:show_when_ready
has detected that the pointer is ready to be shown and when the pointer is actually shown. Any default set here may be overridden whenactive_pointer:show_when_ready
,active_pointer:show_after_active_pointer
oractive_pointer:show_on_event
are called.Parameters:
1
Delay value. This should be set in seconds in campaign, and milliseconds in battle or in the frontend.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers_active.lua, line 475
-
active_pointer:set_default_timeout(
timeoutnumber
)
-
Sets a default timeout period for this active pointer, which is the period over which
active_pointer:show_when_ready
will poll the target uicomponent to see if it becomes visible and stops moving. If the timeout period elapses then the attempt to show the text pointer is stopped. By default this is 5 seconds in campaign, or 5000ms in battle or the frontend.Parameters:
1
Default timeout value. This should be set in seconds in campaign, and milliseconds in battle or in the frontend.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers_active.lua, line 488
While being displayed, the active pointer polls its target uicomponent and will automatically hide itself once the target uicomponent moves or becomes invisible. Due to the inherent delay when polling with a model timer, in certain circumstances there is a visible delay before the text pointer hides. active_pointer:add_hide_on_event_record
can be used to make the active pointer directly respond to script events and hide itself before its poll picks up on a ui state change.
-
active_pointer:add_hide_on_event_record(
event name
string
,
condition
[function
/boolean
],
hide immediately
[boolean
]
) -
Adds a hide-on-event record for this active pointer. If the event is received while the active pointer is being shown, and the optional conditional check passes, then the active pointer is hidden. An optional flag specifies whether this hide should happen immediately, without any fade animation.
Parameters:
1
Script event name.
2
optional, default value=true
Conditional check. This can be a function that returns a boolean, or
true
to always pass when the supplied event is received.3
optional, default value=true
Hide the text pointer immediately, without a fade animation.
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers_active.lua, line 559
-
active_pointer:show()
-
Immediately shows the text pointer, unless it's been set to pay attention to advice history (and has already been shown).
Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers_active.lua, line 606
-
active_pointer:show_when_ready([
delay overridenumber
], [
timeout overridenumber
])
-
Shows the active text pointer when the target uicomponent that was specified when the active pointer was created is not moving, is visible, and is fully onscreen. If this does not happen within the timeout period (default 5 seconds) then the process is cancelled.
Parameters:
1
optional, default value=0
Delay between the uicomponent stopping moving/becoming visible and the text pointer actually being shown. This should be supplied in seconds in campaign, and in milliseconds in battle and the frontend. The default value is 1 second, or 1000ms, or whatever has been set with
active_pointer:set_default_delay
.2
optional, default value=0
Timeout period override. The timeout is the elapsed period after which the show_when_ready process will halt if the target uicomponent has not stopped moving or become visible. In campaign this should be supplied in seconds, and defaults to either 5 or whatever value has been set with
active_pointer:set_default_timeout
. In battle and the frontend, the timeout period is set in milliseconds and defaults to 5000.Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers_active.lua, line 638
These functions are only supported when the active pointer is set to store its use in the advice history - see the Storing in Advice History
section for more information.
-
active_pointer:wait_for_active_pointer(
active pointer name
string
,
delay override
[number
],
timeout override
[number
]
) -
Prevents this active pointer from being shown before another active pointer has been shown. An active pointer may wait for multiple other active pointers, each wait being registered with a call to this function. Should multiple waits be set up for an active pointer, it will fail to display until all active pointers being waited for have finished showing.
This function sets up anactive_pointer:show_after_active_pointer
process automatically, which attempts to show this pointer once the active pointer being waited for is dismissed.
This active pointer must have registered itself in the advice history for this function to work.Parameters:
1
Name of active pointer to wait for. The active pointer being waited for must have registered itself in the advice history.
2
optional, default value=0
Delay override, which will be supplied to
active_pointer:show_when_ready
if this monitor tries to show the pointer. This is the delay between the uicomponent stopping moving/becoming visible and the text pointer actually being shown. This should be supplied in seconds in campaign, and in milliseconds in battle and the frontend. The default value is 1 second, or 1000ms, or whatever has been set withactive_pointer:set_default_delay
.3
optional, default value=0
Timeout period override, which will be supplied to
active_pointer:show_when_ready
if this monitor tries to show the pointer. The timeout is the elapsed period after which the show_when_ready process will halt if the target uicomponent has not stopped moving or become visible. In campaign this should be supplied in seconds, and defaults to either 5 or whatever value has been set withactive_pointer:set_default_timeout
. In battle and the frontend, the timeout period is set in milliseconds and defaults to 5000.Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers_active.lua, line 775
-
active_pointer:show_after_active_pointer(
active pointer name
string
,
delay override
[number
],
timeout override
[number
]
) -
Sets up a listener that attempts to show this active pointer once the specified active pointer closes. Unlike
active_pointer:wait_for_active_pointer
this doesn't demand that the specified active pointer must have first been shown before this active pointer can be shown - this active pointer could trigger before the specified active pointer (from a different event, for example).
This active pointer must have registered itself in the advice history for this function to work.Parameters:
1
Name of active pointer to wait for. The active pointer being waited for must have registered itself in the advice history.
2
optional, default value=0
Delay override, which will be supplied to
active_pointer:show_when_ready
if this monitor tries to show the pointer. This is the delay between the uicomponent stopping moving/becoming visible and the text pointer actually being shown. This should be supplied in seconds in campaign, and in milliseconds in battle and the frontend. The default value is 1 second, or 1000ms, or whatever has been set withactive_pointer:set_default_delay
.3
optional, default value=0
Timeout period override, which will be supplied to
active_pointer:show_when_ready
if this monitor tries to show the pointer. The timeout is the elapsed period after which the show_when_ready process will halt if the target uicomponent has not stopped moving or become visible. In campaign this should be supplied in seconds, and defaults to either 5 or whatever value has been set withactive_pointer:set_default_timeout
. In battle and the frontend, the timeout period is set in milliseconds and defaults to 5000.Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers_active.lua, line 801
-
active_pointer:show_on_event(
event
string
,
condition
[boolean
/function
],
delay override
[number
],
timeout override
[number
]
) -
Sets the active pointer to trigger when a script event is received, with an optional conditional check that must be passed.
This active pointer must have registered itself in the advice history for this function to work.Parameters:
1
Event name.
2
optional, default value=true
Conditional check. This may be omitted, or
true
may be supplied to always trigger whenever the supplied event is received.3
optional, default value=0
Delay override, which will be supplied to
active_pointer:show_when_ready
if this monitor tries to show the pointer. This is the delay between the uicomponent stopping moving/becoming visible and the text pointer actually being shown. This should be supplied in seconds in campaign, and in milliseconds in battle and the frontend. The default value is 1 second, or 1000ms, or whatever has been set withactive_pointer:set_default_delay
.4
optional, default value=0
Timeout period override, which will be supplied to
active_pointer:show_when_ready
if this monitor tries to show the pointer. The timeout is the elapsed period after which the show_when_ready process will halt if the target uicomponent has not stopped moving or become visible. In campaign this should be supplied in seconds, and defaults to either 5 or whatever value has been set withactive_pointer:set_default_timeout
. In battle and the frontend, the timeout period is set in milliseconds and defaults to 5000.Returns:
nil
defined in ../working_data/script/_lib/lib_text_pointers_active.lua, line 858