Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试制作基于文本的 RPG。有人说这可能太难了,所以我应该为关键字设置不同的颜色。F.eks 有一个锁着的箱子,当你检查它时,你会发现一些钉子是松动的。你可以得到松动的指甲并用它打开胸部。
我如何更改那个单词的颜色?或者我如何使那个单词斜体?
myTextField.htmlText = 'You can get the loose <font color="#ff0000">nail</font> and open the chest with it.'
如果您使用textfield来显示您的文本,它会接受htmlText输入。那里可以接受一些(但不是全部)html 格式。
textfield