Viz script


dim sMaxValueContainerName = (string) "txt_config_result_gap_base"
 dim sResultBaseContainerName = (string) "txt_rank_left"
 dim sResultGapContainerName = (string) "txt_rank_right"
 dim sResultGapMaskContainerName = (string) "result_progress_bar"
dim sBaseContainerName = (string) "ONOFF_RESULT_GAP"
 dim sBaseLineContainerPrefix = (string) "RESULT_GAP"
sub OnInitParameters()
 RegisterPushButton("result_color", "determine color", 1)
 end sub
sub OnExecAction(buttonId As Integer)
dim dMaxValue = CDbl(scene.findcontainer(sMaxValueContainerName).geometry.text)
 dim dResultBaseValue = (double) CDbl(scene.findcontainer(sBaseContainerName).findsubcontainer(sBaseLineContainerPrefix).findsubcontainer(sResultBaseContainerName).geometry.text)
 dim dResultGapValue = (double) CDbl(scene.findcontainer(sBaseContainerName).findsubcontainer(sBaseLineContainerPrefix).findsubcontainer(sResultGapContainerName).geometry.text)
dim dRankLeft = (double) CDbl(scene.findcontainer(sBaseContainerName).findsubcontainer(sBaseLineContainerPrefix).findsubcontainer(sResultBaseContainerName).geometry.text)
 dim dRankRight = (double) CDbl(scene.findcontainer(sBaseContainerName).findsubcontainer(sBaseLineContainerPrefix).findsubcontainer(sResultGapContainerName).geometry.text)
 dim cResultGapMaskContainer = (container) scene.findcontainer(sBaseContainerName).findsubcontainer(sBaseLineContainerPrefix).findsubcontainer(sResultGapMaskContainerName)
dim dPercentage = (double) dResultGapValue/dResultBaseValue
 dim dKeyFrame = FindKeyFrame("result_color_frame")
dim vRed as Double
 dim vGreen as Double
 dim vBlue as Double
 dim vAlpha as Double
if dRankLeft = dRankRight then
 dKeyFrame.MaterialValue.Color.SetRGB(cdbl(255)/255, cdbl(255)/255, cdbl(255)/255)
 else
 if dRankRight < dRankLeft then
 dKeyFrame.MaterialValue.Color.SetRGB(cdbl(31)/255, cdbl(190)/255, cdbl(27)/255)
 else
 dKeyFrame.MaterialValue.Color.SetRGB(cdbl(153)/255, cdbl(1)/255, cdbl(17)/255)
 end if
 end if
end sub


dim sMaxValueContainerName = (string) "txt_config_result_gap_base"
 dim sResultBaseContainerName = (string) "txt_result_left"
 dim sResultGapContainerName = (string) "txt_result_right"
 dim sResultGapMaskContainerName = (string) "result_progress_bar"
dim sBaseContainerName = (string) "ONOFF_RESULT_GAP"
 dim sBaseLineContainerPrefix = (string) "RESULT_GAP"
sub OnInitParameters()
 RegisterPushButton("result_color", "determine color", 1)
 end sub
sub OnExecAction(buttonId As Integer)
dim dMaxValue = CDbl(scene.findcontainer(sMaxValueContainerName).geometry.text)
 dim dResultBaseValue = (double) CDbl(scene.findcontainer(sBaseContainerName).findsubcontainer(sBaseLineContainerPrefix).findsubcontainer(sResultBaseContainerName).geometry.text)
 dim dResultGapValue = (double) CDbl(scene.findcontainer(sBaseContainerName).findsubcontainer(sBaseLineContainerPrefix).findsubcontainer(sResultGapContainerName).geometry.text)
 dim cResultGapMaskContainer = (container) scene.findcontainer(sBaseContainerName).findsubcontainer(sBaseLineContainerPrefix).findsubcontainer(sResultGapMaskContainerName)
 dim dPercentage = (double) dResultGapValue/dResultBaseValue
 dim dKeyFrame = FindKeyFrame("result_color_frame")
dim vRed as Double
 dim vGreen as Double
 dim vBlue as Double
 dim vAlpha as Double
if dPercentage = 1 then
 dKeyFrame.MaterialValue.Color.SetRGB(cdbl(255)/255, cdbl(255)/255, cdbl(255)/255)
 else
 if dPercentage > 1 then
 dKeyFrame.MaterialValue.Color.SetRGB(cdbl(31)/255, cdbl(190)/255, cdbl(27)/255)
 else
 dKeyFrame.MaterialValue.Color.SetRGB(cdbl(153)/255, cdbl(1)/255, cdbl(17)/255)
 end if
 end if
end sub

<-- sendCommand("MAIN_SCENE*TREE*$VW_SCALE_INTERN*SCRIPT INVOKE ResizeScene TRUE")
sub ResizeScene(banner As Boolean)
 if banner = false then
 this.scaling.x = 1.0
 this.scaling.y = 1.0 
 this.scaling.z = 1.0
 cBg.active = true
 else
 this.scaling.x = 0.9
 this.scaling.y = 0.9
 this.scaling.z = 0.9
 cBg.active = false
 end if
end sub

dim cSponsor = this.scene.findcontainer("$ONOFF_SHOW_BANNER")
dim cTest = (container) scene.findcontainer("$ONOFF_SHOW_BANNER")

dim cTarget = (container) scene.findcontainer("MAIN_SCENE*TREE*$VW_SCALE_INTERN")

sub OnInitParameters()
 RegisterPushButton("action", "TEST", 1)
end sub

Sub OnExecAction(buttonId as Integer)
 if cSponsor.active = false then
 sendCommand("MAIN_SCENE*TREE*$VW_SCALE_INTERN*SCRIPT INVOKE ResizeScene FALSE")
 cTarget.scaling.x = 1.0
 cTarget.scaling.y = 1.0 
 cTarget.scaling.z = 1.0
 else
 sendCommand("MAIN_SCENE*TREE*$VW_SCALE_INTERN*SCRIPT INVOKE ResizeScene TRUE")
 cTarget.scaling.x = 0.9
 cTarget.scaling.y = 0.9
 cTarget.scaling.z = 0.9 
 end if
end sub

sub ResizeScene(banner As Boolean)
 if banner = false then
 this.scaling.x = 1.0
 this.scaling.y = 1.0 
 this.scaling.z = 1.0
 else
 this.scaling.x = 0.9
 this.scaling.y = 0.9
 this.scaling.z = 0.9
 end if
end sub