2022-06-14, 23:59
Hello again, Kodi community. One part of my video add-on involves displaying a text disclaimer at the beginning of a video using a custom window:
I'm concerned about having enough visual contrast between the text and the video playback behind it (for example, if the text is white, and the video is a very light color). I noticed that text boxes in XML format have the option to define a shadow color (see the Text Box page on the Kodi wiki), like this:
Is there a way to define a shadow color for a Text Box via Python? Thanks so much in advance!
python:class Disclaimer(object):
def __init__(self):
self.showing = False
self.window = xbmcgui.Window(12005) # Overlaps the video without overlapping the video interface
self._disclaimerText = xbmcgui.ControlTextBox(20, 20, 400, 200)
def show(self):
if not self.showing:
self.showing=True
self.window.addControl(self._disclaimerText)
# hide and close methods
...
I'm concerned about having enough visual contrast between the text and the video playback behind it (for example, if the text is white, and the video is a very light color). I noticed that text boxes in XML format have the option to define a shadow color (see the Text Box page on the Kodi wiki), like this:
xml:<control type="textbox" id="2">
<textcolor>FFFFFFFF</textcolor>
<shadowcolor>00000000</shadowcolor>
<!-- Other control attributes -->
...
</control>
Is there a way to define a shadow color for a Text Box via Python? Thanks so much in advance!