-
Notifications
You must be signed in to change notification settings - Fork 0
Non export classes
Mike edited this page May 27, 2021
·
6 revisions
Classes you don't need to know about.
Base class for all lines
Add new line and get result:
const line = new Line();
lineHolder.appendChild(line.mainEl);
line.focus();
const result = line.ask(); //except Line and LineText, because they don't resolve Promise.
Creates and returns Promise
Sets focus to input, if any
Reject Promise with text "TextGameEngine: Line removed before resolve"
used by TextGameEngine.clear()
Created by TextGameEngine.print()
const line = LineText(text: string, newParagraph: boolean, styles: TextStyles)
Created by TextGameEngine.num()
const line = LineGetNum(min: number | null, max: number | null)
Created by TextGameEngine.text()
const line = LineGetText(min: number, max: number, trimSpaces: boolean, allowSpaces: boolean)
Created by TextGameEngine.choose()
const line = LineChoose(options: (string | number)[], newLine: boolean, removeNotChosen: boolean, styles: TextStyles)
Class that contains user styles and formats text
Formats text and return HTMLDivElement with text
const textDiv = textStyles.style(text: string)
Sets new styles, converts strings into StyledText
textStyles.setStyles(styles: string[])
Removes formatting symbols from string
const text = textStyles.removeFormatting(text: string)
Class that contain text and its style
Field | Default |
---|---|
italic | false |
bold | false |
underline | false |
color | "" |
text | "" |
clearPrev | false |
link | "" |
clearPrev - used by parser