Difference between revisions of "PostString"

From NWN Lexicon
Jump to: navigation, search
m (Remarks: added font support notes)
m (Remarks: added link to nwn font maker)
Line 65: Line 65:
 
"As of the 8193.8 patch that added this feature, the only fonts that will work for the sFont parameter, out of the box, are "fnt_galahad14" and "fnt_console" (default).  Others might work, but there might be issues as the fonts may not be complete. You can make your own and use that."
 
"As of the 8193.8 patch that added this feature, the only fonts that will work for the sFont parameter, out of the box, are "fnt_galahad14" and "fnt_console" (default).  Others might work, but there might be issues as the fonts may not be complete. You can make your own and use that."
 
-sherincall in the Neverwinter Vault #nwnee Discord channel.
 
-sherincall in the Neverwinter Vault #nwnee Discord channel.
 +
 +
[https://neverwintervault.org/project/nwn1/other/tool/nwn-font-maker NWN Font Maker] may be useful to create new fonts.
  
 
===Version===
 
===Version===

Revision as of 20:48, 16 March 2020

Warning icon orange.png Caution: This article documents NWN: Enhanced Edition content, not native BioWare scripts. It may not apply unless you're using NWN: Enhanced Edition.
Displays sMsg on oPC's screen.
void PostString(
    object oPC,
    string sMsg,
    int nX = 0,
    int nY = 0,
    int nAnchor = SCREEN_ANCHOR_TOP_LEFT,
    float fLife = 10.0f,
    int nRGBA = 2147418367,
    int nRGBA2 = 2147418367,
    int nID = 0, string sFont=""
);

Parameters

oPC
The player to send the string message.
sMsg
The message string to post.
nX
coordinates of the first character to be displayed. The value is in terms
of character 'slot' relative to the nAnchor anchor point.
If the number is negative, it is applied from the right.
nY
coordinates of the first character to be displayed. The value is in terms
of character 'slot' relative to the nAnchor anchor point.
If the number is negative, it is applied from the bottom.
nAnchor
SCREEN_ANCHOR_* constant.
fLife
Duration in seconds until the string disappears.
nRGBA
Colors of the string in 0xRRGGBBAA format. String starts at nRGBA,
but as it nears end of life, it will slowly blend into nRGBA2.
nRGBA2
Colors of the string in 0xRRGGBBAA format. String starts at nRGBA,
but as it nears end of life, it will slowly blend into nRGBA2.
nID
Optional ID of a string. If not 0, subsequent calls to PostString will
remove the old string with the same ID, even if it's lifetime has not elapsed.
Only positive values are allowed.
sFont
If specified, use this custom font instead of default console font.

Description

Displays sMsg on oPC's screen.

The message is displayed on top of whatever is on the screen, including UI elements.


Remarks

"As of the 8193.8 patch that added this feature, the only fonts that will work for the sFont parameter, out of the box, are "fnt_galahad14" and "fnt_console" (default). Others might work, but there might be issues as the fonts may not be complete. You can make your own and use that." -sherincall in the Neverwinter Vault #nwnee Discord channel.

NWN Font Maker may be useful to create new fonts.

Version

1.74.8193.8

Example

Information icon.png This article is in need of examples. You can help the NWN Lexicon by showing how to use this code effectively.

See Also

constants:

SCREEN_ANCHOR_* Constant Group