Adding some more code that doesnt work yet
this is what i thought i had pushed the other night
This commit is contained in:
@@ -24,7 +24,8 @@ from xml.dom import minidom
|
|||||||
# Won't work yet...
|
# Won't work yet...
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
def CreateLowerThird
|
class RealTimeNotifications
|
||||||
|
def CreateLowerThird
|
||||||
# define the font path as local fonts dir in prj root
|
# define the font path as local fonts dir in prj root
|
||||||
fonts_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'fonts')
|
fonts_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'fonts')
|
||||||
font = ImageFont.truetype(os.path.join(fonts_path, 'sans_serif.ttf'), 24)
|
font = ImageFont.truetype(os.path.join(fonts_path, 'sans_serif.ttf'), 24)
|
||||||
@@ -39,6 +40,46 @@ def CreateLowerThird
|
|||||||
draw.text((0, 0),notitxt,(255,255,255),font=font)
|
draw.text((0, 0),notitxt,(255,255,255),font=font)
|
||||||
img.save('sample-out.jpg')
|
img.save('sample-out.jpg')
|
||||||
|
|
||||||
|
def DisplayLowerThird(displaytime, position):
|
||||||
|
global myWidget
|
||||||
|
global intYOffset
|
||||||
|
global __addon__
|
||||||
|
|
||||||
|
__addon__ = xbmcaddon.Addon(id='service.lowerthird')
|
||||||
|
|
||||||
|
ActWin = xbmcgui.getCurrentWindowId()
|
||||||
|
myWidget = OverlayText(ActWin)
|
||||||
|
myWidget.show()
|
||||||
|
|
||||||
|
if position == 'top':
|
||||||
|
myWidget.imageBottom.setImage("")
|
||||||
|
myWidget.imageCenter.setImage("")
|
||||||
|
myWidget.imageTop.setImage("sample-out.jpg")
|
||||||
|
elif position == 'bottom':
|
||||||
|
myWidget.imageBottom.setImage("sample-out.jpg")
|
||||||
|
myWidget.imageCenter.setImage("")
|
||||||
|
myWidget.imageTop.setImage("")
|
||||||
|
else:
|
||||||
|
myWidget.imageBottom.setImage("")
|
||||||
|
myWidget.imageCenter.setImage("sample-out.jpg")
|
||||||
|
myWidget.imageTop.setImage("")
|
||||||
|
|
||||||
|
image = Image.open(open("sample-out.jpg", 'rb'))
|
||||||
|
width, height = image.size
|
||||||
|
myWidget.scaleimage(width, height, intYOffset)
|
||||||
|
|
||||||
|
xbmc.log('BANNERS >> STANDALONE INITIALIZING OVERLAY')
|
||||||
|
|
||||||
|
xbmc.sleep(displaytime)
|
||||||
|
|
||||||
|
try:
|
||||||
|
myWidget._close()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
myWidget = None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user