- Joined
- May 28, 2020
- Messages
- 832
It looks like a very good feature.
(2 ratings)
QuestText.CreateWindow
as laid out in the API section. If you don't know what to use a the parent frame, use BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0)
. Save the window to a variable. Then do QuestText.New
to write a text into that window.whichWindow or windows[1]
repetition but it is no concern.I don't suspect it would be too difficult. You can give it a try and I can help you out if you get stuck.How difficult would it be to make a Jass version of this?
self.length = text:len()
local char
local beginningOfWord = 0
for i = 1, self.length do
char = text:sub(i, i)
if char == " " or char == "\n" then
self.words[#self.words + 1] = text:sub(beginningOfWord, i-1):gsub("\n", "")
beginningOfWord = i
elseif i == self.length then
self.words[#self.words + 1] = text:sub(beginningOfWord, i):gsub("\n", "")
end
end
string.sub()
and string.len()
will produce unexpected results because they operate on bytes, not characters. Also, since the loop iterates byte-by-byte (for i = 1, self.length do
), multi-byte characters will be split into separate bytes rather than whole characters. local frame = BlzCreateFrameByType("BACKDROP", "",
BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0),
"", 0)
BlzFrameSetAbsPoint(frame, FRAMEPOINT_CENTER, 0.4, 0.3)
BlzFrameSetSize(frame, 0.3, 0.3)
BlzFrameSetTexture(frame, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 0, true)
local mainWindow = QuestText.CreateWindow({
parent = frame,
yBottom = 0 - 0.1,
xLeft = 0 - 0.005,
yTop = 0 - 0.05,
xRight = 0 + 0.1,
isAbsolute = false,
isAsync = true,
maxCharacters = 1000,
fontSize = 60,
lineSpacing = 0.3,--0.012,
writeSpeed = 10,
fadeInTime = 0.6,
})
QuestText.New("Eternal Odyssey", mainWindow, Player(0))