From 4fe3e0dac24455311a9d187fba4f1b26916870e3 Mon Sep 17 00:00:00 2001 From: Neil Burrows Date: Thu, 11 Jun 2020 07:57:31 +0100 Subject: [PATCH] Animate Poster Scaling --- components/ItemGrid2/GridItem.brs | 15 ++++++++------- components/ItemGrid2/GridItem.xml | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/components/ItemGrid2/GridItem.brs b/components/ItemGrid2/GridItem.brs index 9fb84111..c857f390 100644 --- a/components/ItemGrid2/GridItem.brs +++ b/components/ItemGrid2/GridItem.brs @@ -22,18 +22,19 @@ sub itemContentChanged() end sub ' -'Resize Poster and Title Vivbility on focus change +'Use FocusPercent to animate scaling of Poser Image +sub focusChanging() + scaleFactor = 1 + (m.top.focusPercent * 0.17333) + m.itemPoster.scale = [scaleFactor, scaleFactor] +end sub + +' +'Display or hide title Visibility on focus change sub focusChanged() if m.top.itemHasFocus = true then - m.itemPoster.width = 295 - m.itemPoster.height = 440 - m.itemPoster.translation = [0,0] m.itemText.visible = true else - m.itemPoster.width = 250 - m.itemPoster.height = 375 - m.itemPoster.translation = [21,35] m.itemText.visible = false end if diff --git a/components/ItemGrid2/GridItem.xml b/components/ItemGrid2/GridItem.xml index 7e885f4c..8fcf9fd9 100644 --- a/components/ItemGrid2/GridItem.xml +++ b/components/ItemGrid2/GridItem.xml @@ -1,12 +1,13 @@ - + +