Bellow是使用roImageCanvas在Roku中显示字符串的代码。
canvas = CreateObject("roImageCanvas")
port = CreateObject("roMessagePort")
canvas.SetMessagePort(port)
items = []
items.Push({
Text: "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s"
TextAttrs:{ font: "small", color: "#a0a0a0" ,Direction:"LeftToRight",HAlign:"Left",VAlign:"top"}
TargetRect: {x: 550, y: 75, w: 300, h: 500}
})
canvas.SetLayer(0, { Color: "#ff000000", CompositionMode: "Source" })
canvas.SetLayer(1, items)
canvas.Show()这将创建一个类似于下面的输出

可以调整每一行之间的间距吗?
注意:我需要使用roImageCanvas,,因为这个页面需要一些带有图像的图形
发布于 2015-05-29 19:39:41
不幸的是,在roImageCanvas上控制间距的唯一方法是使用自己的TargetRects将文本拆分成单独的字符串。
https://stackoverflow.com/questions/30497809
复制相似问题