btpoole
10 years agoChannel Surfer
Text Placement on roImageCanvas
Running into a situation with displaying text on a canvas. I am looping thru an array, parsing information out, and displaying up to 4 pairs of information on the screen. The information on the screen thru code:
The loop runs fine and all is displayed but the location never works out exactly right. The first set is perfect, the location and spacing is correct. Starting with the second set which has the y set by increasing the previous location by 35 starts to get off. By the time all of the pairs are displayed, the second line of text "TITLE" is overlapping the previous line "Date/Time". I have tried numerous combinations of changing "h" and the initial starting of the "y" but nothing seems to keep the spacing. I either end up with a growing gap between "Date/Time" and "Title" or they overlap. Since the only thing changing is the y value should not the spacing remain the same? Is there a missing element?
Thanks
dTxt=50
tTxt=75
displaylist.Push({
Text:datetime 'DATE/TIME
TextAttrs: {color: m.guidecolor, font: "medium"}
TargetRect: {x:315, y:dTxt, w: 300, h: 30}
})
displaylist.Push({
Text:title 'TITLE
TextAttrs: {color: m.guidecolor, font: "medium"}
TargetRect: {x:315, y:tTxt, w: 300, h: 30}
})
dTxt=dTxt + 35
tTxt=tTxt + 35
The loop runs fine and all is displayed but the location never works out exactly right. The first set is perfect, the location and spacing is correct. Starting with the second set which has the y set by increasing the previous location by 35 starts to get off. By the time all of the pairs are displayed, the second line of text "TITLE" is overlapping the previous line "Date/Time". I have tried numerous combinations of changing "h" and the initial starting of the "y" but nothing seems to keep the spacing. I either end up with a growing gap between "Date/Time" and "Title" or they overlap. Since the only thing changing is the y value should not the spacing remain the same? Is there a missing element?
Thanks