2020-06-10 16:43:32 +00:00
|
|
|
sub init()
|
2020-06-18 15:09:18 +00:00
|
|
|
m.posterMask = m.top.findNode("posterMask")
|
2020-06-10 16:43:32 +00:00
|
|
|
m.itemPoster = m.top.findNode("itemPoster")
|
2020-07-04 15:10:56 +00:00
|
|
|
m.posterText = m.top.findNode("posterText")
|
2020-06-10 16:43:32 +00:00
|
|
|
m.itemText = m.top.findNode("itemText")
|
2020-07-04 15:10:56 +00:00
|
|
|
m.backdrop = m.top.findNode("backdrop")
|
|
|
|
|
|
|
|
m.itemPoster.observeField("loadStatus", "onPosterLoadStatusChanged")
|
2020-06-18 15:09:18 +00:00
|
|
|
|
|
|
|
m.itemText.translation = [0, m.itemPoster.height + 7]
|
2020-06-10 16:43:32 +00:00
|
|
|
end sub
|
|
|
|
|
|
|
|
sub itemContentChanged()
|
|
|
|
|
2020-07-04 15:10:56 +00:00
|
|
|
' Set Randmom background colors from pallet
|
|
|
|
posterBackgrounds = m.global.poster_bg_pallet
|
|
|
|
m.backdrop.color = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
|
|
|
|
|
2020-06-10 16:43:32 +00:00
|
|
|
itemData = m.top.itemContent
|
|
|
|
|
|
|
|
if itemData = invalid then return
|
|
|
|
|
|
|
|
if itemData.type = "Movie" then
|
2020-06-18 15:09:18 +00:00
|
|
|
m.itemPoster.uri = itemData.PosterUrl
|
2020-06-10 16:43:32 +00:00
|
|
|
m.itemText.text = itemData.Title
|
2020-06-15 16:05:48 +00:00
|
|
|
else if itemData.type = "Series" then
|
2020-06-18 15:09:18 +00:00
|
|
|
m.itemPoster.uri = itemData.PosterUrl
|
2020-06-15 16:05:48 +00:00
|
|
|
m.itemText.text = itemData.Title
|
2020-06-23 16:12:47 +00:00
|
|
|
else if itemData.type = "Boxset" then
|
2020-07-04 15:10:56 +00:00
|
|
|
m.itemPoster.uri = itemData.PosterUrl
|
2020-06-23 16:12:47 +00:00
|
|
|
m.itemText.text = itemData.Title
|
2020-07-04 15:10:56 +00:00
|
|
|
else
|
|
|
|
print "Unhandled Item Type: " + itemData.type
|
2020-06-10 16:43:32 +00:00
|
|
|
end if
|
|
|
|
|
2020-07-04 15:10:56 +00:00
|
|
|
m.posterText.text = m.itemText.text
|
2020-06-10 16:43:32 +00:00
|
|
|
|
|
|
|
end sub
|
|
|
|
|
|
|
|
'
|
2020-06-11 06:57:31 +00:00
|
|
|
'Use FocusPercent to animate scaling of Poser Image
|
|
|
|
sub focusChanging()
|
2020-06-18 15:09:18 +00:00
|
|
|
scaleFactor = 0.85 + (m.top.focusPercent * 0.15)
|
|
|
|
m.posterMask.scale = [scaleFactor, scaleFactor]
|
2020-06-11 06:57:31 +00:00
|
|
|
end sub
|
|
|
|
|
|
|
|
'
|
|
|
|
'Display or hide title Visibility on focus change
|
2020-06-10 16:43:32 +00:00
|
|
|
sub focusChanged()
|
|
|
|
|
|
|
|
if m.top.itemHasFocus = true then
|
|
|
|
m.itemText.visible = true
|
2020-07-04 15:10:56 +00:00
|
|
|
m.itemText.repeatCount = -1
|
2020-06-10 16:43:32 +00:00
|
|
|
else
|
|
|
|
m.itemText.visible = false
|
2020-07-04 15:10:56 +00:00
|
|
|
m.itemText.repeatCount = 0
|
2020-06-10 16:43:32 +00:00
|
|
|
end if
|
|
|
|
|
|
|
|
end sub
|
2020-07-04 15:10:56 +00:00
|
|
|
|
|
|
|
'Hide backdrop and text when poster loaded
|
|
|
|
sub onPosterLoadStatusChanged()
|
|
|
|
if m.itemPoster.loadStatus = "ready" then
|
|
|
|
m.backdrop.visible = false
|
|
|
|
m.posterText.visible = false
|
|
|
|
end if
|
|
|
|
end sub
|