--- onShowTextDraw
function handler.on_show_textdraw_reader(bs)
local read = BitStreamIO.bs_read
local data = {}
local textdrawId = read.int16(bs)
data.flags = read.int8(bs)
data.letterWidth = read.float(bs)
data.letterHeight = read.float(bs)
data.letterColor = read.int32(bs)
data.lineWidth = read.float(bs)
data.lineHeight = read.float(bs)
data.boxColor = read.int32(bs)
data.shadow = read.int8(bs)
data.outline = read.int8(bs)
data.backgroundColor = read.int32(bs)
data.style = read.int8(bs)
data.selectable = read.int8(bs)
data.position = read.vector2d(bs)
data.modelId = read.int16(bs)
data.rotation = read.vector3d(bs)
data.zoom = read.float(bs)
data.color = read.int32(bs)
data.text = read.string16(bs)
return {textdrawId, data}
end
function handler.on_show_textdraw_writer(bs, data)
local write = BitStreamIO.bs_write
local textdrawId = data[1]
local data = data[2]
write.int16(bs, textdrawId)
write.int8(bs, data.flags)
write.float(bs, data.letterWidth)
write.float(bs, data.letterHeight)
write.int32(bs, data.letterColor)
write.float(bs, data.lineWidth)
write.float(bs, data.lineHeight)
write.int32(bs, data.boxColor)
write.int8(bs, data.shadow)
write.int8(bs, data.outline)
write.int32(bs, data.backgroundColor)
write.int8(bs, data.selectable)
write.vector2d(bs, data.position)
write.int16(bs, data.modelId)
write.vector3d(bs, data.rotation)
write.float(bs, data.zoom)
write.int32(bs, data.color)
write.string16(bs, data.text)
end
local function read_object_material(bs)
local read = BitStreamIO.bs_read
local data = {}
data.materialId = read.int8(bs)
data.modelId = read.int16(bs)
data.libraryName = read.string8(bs)
data.textureName = read.string8(bs)
data.color = read.int32(bs)
return data
end
local function write_object_material(bs, data)
local write = BitStreamIO.bs_write
write.int8(bs, 1)
write.int8(bs, data.materialId)
write.int16(bs, data.modelId)
write.string8(bs, data.libraryName)
write.string8(bs, data.textureName)
write.int32(bs, data.color)
end
local function read_object_material_text(bs)
local read = BitStreamIO.bs_read
local data = {}
data.materialId = read.int8(bs)
data.materialSize = read.int8(bs)
data.fontName = read.string8(bs)
data.fontSize = read.int8(bs)
data.bold = read.int8(bs)
data.fontColor = read.int32(bs)
data.backGroundColor = read.int32(bs)
data.align = read.int8(bs)
data.text = read.encodedString2048(bs)
return data
end
local function write_object_material_text(bs, data)
local write = BitStreamIO.bs_write
write.int8(bs, 2)
write.int8(bs, data.materialId)
write.int8(bs, data.materialSize)
write.string8(bs, data.fontName)
write.int8(bs, data.fontSize)
write.int8(bs, data.bold)
write.int32(bs, data.fontColor)
write.int32(bs, data.backGroundColor)
write.int8(bs, data.align)
write.encodedString2048(bs, data.text)
end