文档
句子

句子

句子是角色的一部分。它用于构建对话。

构建句子:

import { Sentence } from 'narraleaf-react';
 
const character = new Character("character 1");
const sentence = new Sentence([
    "Hello, ",
    Word.color("world", "#f00") // words can be colored,
], {
    character,
});

const sentence = new Sentence("Hello, world");

const sentence = new Sentence([
    "Hello, ", persis.get("playerName"), "!"
]);
 

公共方法

constructor

copy

Copy the sentence

const sentence = new Sentence("你好,世界");
const sentence2 = sentence.copy();
  • Returns: Sentence