Text background overwrites letters

I’m displaying Hebrew text in my app, with diacritical marks (punctuation, etc.). These marks get displayed above, below and in the middle of letters. Each word is emitted separately with a display.newText, added to a group.

When I display a string with the marks embedded in the text, all is well with the display.

When I group letters until I come to a diacritical mark, display the letters, then display the diacritical mark, then display more letters, etc., the background for the diacritical mark that might be below a letter overwrites the letter with a white rectangle–obliterating the letter.

Is there a workaround for this? Attempting to set a fill color with a zero Alpha channel:
textObj[WordCount]:setFillColor(0, 0, 0, 0)

on the text object produces an error: “attempt to call method ‘setFillColor’ (a nil value)”

TIA,
-Tom [import]uid: 100708 topic_id: 25171 reply_id: 325171[/import]

Admittedly I am not 100% sure on what is happening here as I am not that familiar with Hebrew writing.

If you are asking how to set a fill color with zero alpha I believe perhaps textObj[WordCount].isVisible = false should do the trick, or .alpha, rather than changing the color and alpha at once.

Please let me know if this helps.

Peach :slight_smile: [import]uid: 52491 topic_id: 25171 reply_id: 102232[/import]

Peach,
Thanks, however both of your suggestions are making the text disappear rather than the background behind the text.

Imagine a foreign letter with an accent mark, such as an “a” whose above which is an accent. Imagine that I am displaying in one text object the “a”, and then want to display the accent ~ in a different color by displaying it in a second text object whose left alignment is the same as the “a”, and a bit higher. The ~ is displayed, however the bounding box around the ~ character causes the “a” to be mostly obliterated.

Setting textObj[2].alpha = 0 causes the ~ to disappear.

-Tom
[import]uid: 100708 topic_id: 25171 reply_id: 102267[/import]

In my experience all text has a transparent background. I have never run into this situation. If the markings you are using to accent the other text are indeed a font also, I would suspect the font is the issue, not display.newText. However newText has had it’s bugs before. Which Corona build are you using? Have you tried other builds? [import]uid: 56820 topic_id: 25171 reply_id: 102312[/import]

I’m using 2012.773, and have not tried other builds.

Just to be clear, I’m using a ScrollView.lua that Ansca put out in 2010, in which each display element to be scrolled is inserted into a table.

Adding text including diacriticals as a single text object inserted into the ScrollView works fine. Overlapping multiple text objects inserted into the ScrollView (e.g. overlapping text objects:
txtObj[1] = “a”
txtObj[2] = “^”

provokes the problem, as it seems txtObj[2] is higher in the display’s z-order than txtObj[1].

-Tom [import]uid: 100708 topic_id: 25171 reply_id: 102535[/import]

That’s some old code. I know they now use widgets to do these sorts of things. I don’t know if the problem is a bug or a limitation of the old code your using.

Maybe someone with experience or more knowledge of the old style scrollview can comment. Your other option is perhaps replacing it with the new scrollview widget from the widget library. [import]uid: 56820 topic_id: 25171 reply_id: 102559[/import]

Anderoth,
Thanks. I tried the ScrollView widget, but before testing my specific issue, I tried its basic functionality and I’m seeing that the scrollview widget (using defaults) does not appear to have a scrollbar. This seems like a huge omission or bug, but I’ve found no links or reports about this at all.

-Tom

[import]uid: 100708 topic_id: 25171 reply_id: 102717[/import]

? [import]uid: 89165 topic_id: 25171 reply_id: 102307[/import]