TextPageScrollViewTag

text-page

Description

Display a scroll view with text inside

Components and Properties

Graphic

raycast-padding

Vector4

Padding to be applied to the masking, ordered counter-clockwise (left, bottom, right, top).

raycast-target

raycast

bool

Whether or not this graphic be considered a target for raycasting.

LocalizedTextMeshProUGUI

maintain-text-alignment

bool

Whether or not to maintain the text alignment regardless of the reading direction of the current language.

text-key

localization key

The localization key for the text to display.

RectTransform

active

bool

Whether or not the GameObject this RectTransform belongs to is active.

anchor-max

Vector2

The anchor point for the upper right corner of the rectangle defined as a fraction of the size of the parent rectangle.

anchor-max-x

float

The normalized x position in the parent RectTransform that the upper right corner is anchored to.

anchor-max-y

float

The normalized y position in the parent RectTransform that the upper right corner is anchored to.

anchor-min

Vector2

The anchor point for the lower left corner of the rectangle defined as a fraction of the size of the parent rectangle.

anchor-min-x

float

The normalized x position in the parent RectTransform that the lower left corner is anchored to.

anchor-min-y

float

The normalized y position in the parent RectTransform that the lower left corner is anchored to.

anchored-position

Vector2

Position of the rectangle’s pivot point relative to the anchors.

anchored-position-x

anchor-pos-x

float

The x position of the pivot of this RectTransform relative to the anchor reference point.

anchored-position-y

anchor-pos-y

float

The y position of the pivot of this RectTransform relative to the anchor reference point.

hover-hint

string

Text that will appear when a pointer hovers over.

hover-hint-key

localization key

The localization key used for the hover hint text.

local-scale

scale

Vector3

Scale factor applied to the object in the X, Y and Z dimensions.

name

string

The name of the GameObject.

pivot

Vector2

The location around which the rectangle rotates.

pivot-x

float

Normalized x position to rotate around.

pivot-y

float

Normalized y position to rotate around.

size-delta

Vector2

The size added to the rectangle defined by the anchors.

size-delta-x

float

The width added to the rectangle defined by the anchors.

size-delta-y

float

The height added to the rectangle defined by the anchors.

TextMeshProUGUI

font-align

align

TextAlignmentOptions

How to align the text.

all-uppercase

bool

Whether or not to make the text all uppercase.

bold

bool

Whether or not text is bold.

font-color

color

color string

Color of font.

face-color

color string

Face color of font.

font-size

float

Size of font.

italics

bool

Whether or not to italicize text.

outline-color

color string

Outline color of font.

outline-width

float

Width of font outline.

overflow-mode

TextOverflowModes

How to handle text overflow.

rich-text

bool

Whether or not to enable rich text.

strikethrough

bool

Whether or not to strikethrough text.

text

string

Text to display.

underlined

bool

Whether or not to underline text.

word-wrapping

bool

Whether or not to wrap text.

###

Example Usage

example.bsml

<vertical horizontal-fit="Unconstrained">
  <horizontal vertical-fit="Unconstrained">
    <text-page text="~lorem-ipsum" />
  </horizontal>
  <horizontal vertical-fit="Unconstrained">
    <text-page text="~lorem-ipsum-r" />
  </horizontal>
</vertical>
using BeatSaberMarkupLanguage.Attributes;
using BeatSaberMarkupLanguage.Parser;
using BeatSaberMarkupLanguage.ViewControllers;

public class TestViewController : BSMLResourceViewController
{
    public override string ResourceName => "Path.To.Resource.example.bsml";

    [UIParams]
    private BSMLParserParams parserParams;

    [UIValue("lorem-ipsum")]
    public static string loremIpsum =
        "Ut enim quisque sibi plurimum confidit et ut quisque maxime virtute et sapientia sic munitus est, " +
        "ut nullo egeat suaque omnia in se ipso posita iudicet, ita in amicitiis expetendis colendisque " +
        "maxime excellit. Quid enim? Africanus indigens mei? Minime hercule! ac ne ego quidem illius; " +
        "sed ego admiratione quadam virtutis eius, ille vicissim opinione fortasse non nulla, quam de meis " +
        "moribus habebat, me dilexit; auxit benevolentiam consuetudo. Sed quamquam utilitates multae et " +
        "magnae consecutae sunt, non sunt tamen ab earum spe causae diligendi profectae.\n\nInter quos " +
        "Paulus eminebat notarius ortus in Hispania, glabro quidam sub vultu latens, odorandi vias periculorum " +
        "occultas perquam sagax. is in Brittanniam missus ut militares quosdam perduceret ausos conspirasse Magnentio, " +
        "cum reniti non possent, iussa licentius supergressus fluminis modo fortunis conplurium sese repentinus infudit " +
        "et ferebatur per strages multiplices ac ruinas, vinculis membra ingenuorum adfligens et quosdam obterens manicis," +
        " crimina scilicet multa consarcinando a veritate longe discreta. unde admissum est facinus impium, quod Constanti tempus " +
        "nota inusserat sempiterna.\n\nThalassius vero ea tempestate praefectus praetorio praesens ipse quoque adrogantis " +
        "ingenii, considerans incitationem eius ad multorum augeri discrimina, non maturitate vel consiliis mitigabat, " +
        "ut aliquotiens celsae potestates iras principum molliverunt, sed adversando iurgandoque cum parum congrueret, " +
        "eum ad rabiem potius evibrabat, Augustum actus eius exaggerando creberrime docens, idque, incertum qua mente, " +
        "ne lateret adfectans. quibus mox Caesar acrius efferatus, velut contumaciae quoddam vexillum altius erigens, " +
        "sine respectu salutis alienae vel suae ad vertenda opposita instar rapidi fluminis irrevocabili impetu " +
        "ferebatur.\n\nUt enim quisque sibi plurimum confidit et ut quisque maxime virtute et sapientia sic munitus" +
        " est, ut nullo egeat suaque omnia in se ipso posita iudicet, ita in amicitiis expetendis colendisque maxime" +
        " excellit. Quid enim? Africanus indigens mei? Minime hercule! ac ne ego quidem illius; sed ego admiratione " +
        "quadam virtutis eius, ille vicissim opinione fortasse non nulla, quam de meis moribus habebat, me dilexit; " +
        "auxit benevolentiam consuetudo. Sed quamquam utilitates multae et magnae consecutae sunt, non sunt tamen ab " +
        "earum spe causae diligendi profectae.\n\nExcogitatum est super his, ut homines quidam ignoti, vilitate " +
        "ipsa parum cavendi ad colligendos rumores per Antiochiae latera cuncta destinarentur relaturi quae audirent. " +
        "hi peragranter et dissimulanter honoratorum circulis adsistendo pervadendoque divites domus egentium habitu " +
        "quicquid noscere poterant vel audire latenter intromissi per posticas in regiam nuntiabant, id observantes " +
        "conspiratione concordi, ut fingerent quaedam et cognita duplicarent in peius, laudes vero supprimerent Caesaris, " +
        "quas invitis conpluribus formido malorum inpendentium exprimebat.";

    [UIValue("lorem-ipsum-r")]
    private string loremIpsumReverse = ReverseString(loremIpsum);

    public static string ReverseString(string s)
    {
        var array = new char[s.Length];
        var forward = 0;
        for (var i = s.Length - 1; i >= 0; i--)
            array[forward++] = s[i];
        return new string(array);
    }
}

This example will display two text page scrollviews vertically placed, one having a string without modification and the other one reversed.