User Tools

Site Tools


layer:basketball_scores

Basketball Scores Layer

This layer reads a XML file to display basketball scores. Up to three games can be shown. The layer can automatically show all the games when enabled, or you can manually signal each game's scores to slide in. You can use an image for the background or just show the scores above your underlying layers.

Group Parameter Function
Control Auto-Animate When enabled, the layer will slide in all the scores automatically when the layer is set to Live. If disabled, a “Next” button (with assignable shortcut) will be available to manually trigger each section of scores to show.
Content Score XML This is the source to retrieve the scores from. Refer to the code below to see how the file is parsed and download the sample to edit it.
Transition Duration Set the time it takes for all the scores to be shown. The time it takes for each section of scores to slide will be a third of this total time.
Appearance Font You can use the Mac font chooser to adjust how the text will appear. The date in the upper right corner will be slightly smaller than the rest of the text. The score totals on the right will be heavier than the other numbers.
Background Image Choose the image you want for the background. The image will be scaled to fit.
Bars Color Set the color and opacity of the bars under each section of scores.

The default code below is used for the layer when it is first created. You can compare this to the layer to see how each section of scores is derived from the source file. You can have one to three game tags. The four quarters are automatically added to create the totals on the right of each row.

BasketballScores.xml
<?xml version="1.0"?>
<basketballscores>
 
<date>28th April 2008</date>
<games>
	<game>
		<opponent1>
			<name>New York</name>
			<quarter1>26</quarter1>
			<quarter2>24</quarter2>
			<quarter3>18</quarter3>
			<quarter4>24</quarter4>
		</opponent1>
 
		<opponent2>
			<name>Las Vegas</name>
			<quarter1>22</quarter1>
			<quarter2>27</quarter2>
			<quarter3>25</quarter3>
			<quarter4>28</quarter4>
		</opponent2>
	</game>
 
	<game>
		<opponent1>
			<name>Boston</name>
			<quarter1>24</quarter1>
			<quarter2>24</quarter2>
			<quarter3>27</quarter3>
			<quarter4>17</quarter4>
		</opponent1>
 
		<opponent2>
			<name>Atlanta</name>
			<quarter1>29</quarter1>
			<quarter2>22</quarter2>
			<quarter3>14</quarter3>
			<quarter4>32</quarter4>
		</opponent2>
	</game>
 
	<game>
		<opponent1>
			<name>Bogustown</name>
			<quarter1>32</quarter1>
			<quarter2>32</quarter2>
			<quarter3>15</quarter3>
			<quarter4>28</quarter4>
		</opponent1>
 
		<opponent2>
			<name>Anycity</name>
			<quarter1>23</quarter1>
			<quarter2>31</quarter2>
			<quarter3>23</quarter3>
			<quarter4>24</quarter4>
		</opponent2>
	</game>
</games>
</basketballscores>
layer/basketball_scores.txt · Last modified: 2013/08/13 13:03 by david