SamplerName.charCode(int charId) Samples a character at global position charId in the text data, and returns the ASCII code of the sampled character.
SamplerName.charCode(int2 lineAndCharId) Samples a character at line lineAndCharId.x and position lineAndCharId.y within that line, and returns the ASCII code of the sampled character.
SamplerName.charLineId(int charId) Returns an int2 vector containing the 0-based line index of the specified character in x and the 0-based character index relative to the start of the line in y.charId is the global character index in the [0, totalCharCount] range.
SamplerName.charOffset(int charId) Returns the horizontal distance between charId and the beginning of the line in displayable units, where 1.0 is the average glyph size.Takes kerning into account if a kerning file has been provided in the text sampler and its UseKerning property is enabled. Only works for characters whose charCode is in the [0,255] range. If you need to work with some unicode characters, you will need to reencode the text string to map them in free slots of the [0,255] range, and remap their entries in the kerning file.
SamplerName.lineOffset(int lineId) Returns the vertical distance between charId and the beginning of the text in displayable units, where 1.0 is the average glyph size. Defaults to 3.0 if no metrics file has been provided in the text sampler.
SamplerName.charCount() Returns the number of characters in the entire text.
SamplerName.charCount(int charId) Returns the number of characters of the specified line of the text.
SamplerName.lineCount() Returns the number of lines in the entire text.
Disclaimer: These are describing the reference implementation. When using attribute samplers, the behavior of these functions can vary depending on the implementation in the game-engine where the effect is loaded.
Privacy & Cookies Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.