
A series of tutorial videos showing creation of an animated score bug for basketball.
Preparing the Visuals
The first part of the scorebug series shows the preparation of the graphics using CW’s layer creation tools.
Animating the game period displays
This section discusses how the animated period displays are made, dealing with the basics of keyframe animation and the timeline in CW.
Game Time
Scorebugs can be created using the Down Counter element in CW, and this video shows show.
(As an alternative, CW 2.5 introduces Timer cells for Key-Value Data Sources which are far more powerful and flexible).
Driving The Score Using Expressions
This part demonstrates using expressions for dynamic real-time modification of Key-Value Data Source cells
Advanced Animation using Behaviours
The last part examines advanced Behaviour setups on Data Sources for driving animations and expressions.
StatCrew Integration in CharacterWorks
Practical CharacterWorks StatCrew setups for attractive presentations
Sample XQuery Codes for StatCrew SoftWare
Match Global infos
for $gmatch in //bbgame/venue
for $gmatchrule in //bbgame/venue/rules
let $referees := tokenize((data($gmatch/officials/@text)), ‘,’)
return <datarow>
{
for $att in $gmatch/@*
return element{data(name($att))} {data($att)}
}
{
for $att in $gmatchrule/@*
return element{data(name($att))} {data($att)}
}
<offical1>{data($referees[1])} </offical1>
<offical2>{data($referees[2])} </offical2>
<offical3>{data($referees[3])} </offical3>
<notes>{data($gmatch/notes/note/@text)} </notes>
</datarow>
Players
let $players :=”V”
for $mplayer in //bbgame/team[@vh=$players]/player
return <datarow>
{
for $att in $mplayer/@*
return element{data(name($att))} {data($att)}
}
</datarow>
Players on Court
let $team := ‘V’
for $mplayer in //bbgame/team[@vh=$team]/player[@oncourt = ‘Y’]
return <datarow>
{
for $att in $mplayer/@*
return element{data(name($att))} {data($att)}
}
<firstname>{substring-after($mplayer/@name, ‘, ‘)}</firstname>
<lastname>{substring-before($mplayer/@name, ‘,’)}</lastname>
</datarow>
Players and Stats
let $period := ‘1’
let $playerno := ’02’
let $team := ‘H’
for $gtotals in //bbgame/team[@vh=$team]/player[@uni=$playerno]
return <datarow>
{
for $att in $gtotals/statsbyprd[@prd=$period]/@*
return element{data(name($att))} {data($att)}
}
<firstname>{substring-after($gtotals/@name, ‘, ‘)}</firstname>
<lastname>{substring-before($gtotals/@name, ‘,’)}</lastname>
</datarow>
Specials
Specials (H – home V – visitors)
let $specials :=”V”
for $gtotalspecial in //bbgame/team/totals/special[@vh=$specials]
return <datarow>
{
for $att in $gtotalspecial/@*
return element{data(name($att))} {data($att)}
}
</datarow>
Team Stats
let $team :=”H”
let $period :=”1″
for $gtotalstatsbyprd in //bbgame/team[@vh=$team]/totals/statsbyprd[@prd=$period]
return <datarow>
{
for $att in $gtotalstatsbyprd/@*
return element{data(name($att))} {data($att)}
}
</datarow>
Scores
let $team :=”V”
for $result in //bbgame/team[@vh=$team]/linescore/lineprd
return <datarow>
<period>{data($result/@prd)}</period>
<score>{data($result/@score)}</score>
</datarow>
Cool!