lines#1.xml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <screenplay xmlns="urn:screenplay">
  3. <line id="line" x1="0" y1="0" x2="100" y2="0" />
  4. <random id="rRed" min="0" max="255" seed="1900" />
  5. <random id="rBlue" min="0" max="255" seed="50000" />
  6. <random id="rGreen" min="0" max="255" seed="99" />
  7. <event kind="onLoad" >
  8. <matrix id="initialMatrix" translate="[120,100]" />
  9. <paint id="basePaint" strokeWidth="2" antiAlias="true" textAlign="center"
  10. textSize="24" linearText="false" >
  11. <color color="lightblue" />
  12. </paint>
  13. <apply mode="immediate" steps="17" >
  14. <post target="addLine" />
  15. <animate field="delay" from="0.1" to="0.95" />
  16. </apply>
  17. <post id="postAddCaptionFade" target="addCaptionFade" delay="1" />
  18. <post id="postAddLineCaption" target="addLineCaption" delay="1" />
  19. <post target="scaleInitial" delay="2" />
  20. <apply scope="basePaint" begin="3">
  21. <set begin="0" field="linearText" to="false" />
  22. </apply>
  23. </event>
  24. <event kind="user" id="addLine" >
  25. <matrix rotate="20" />
  26. <apply restore="true" >
  27. <paint >
  28. <color id="ramp" />
  29. </paint>
  30. <set target="ramp" field="color" to="rgb(rRed.random,rBlue.random,rGreen.random)" />
  31. </apply>
  32. <add use="line" />
  33. </event>
  34. <event kind="user" id="addCaptionFade" >
  35. <apply>
  36. <paint>
  37. <color id="captionFade" alpha="0" />
  38. </paint>
  39. <animate target="captionFade" field="alpha" from="0" to="1" dur="1" />
  40. </apply>
  41. </event>
  42. <event kind="user" id="addLineCaption" >
  43. <text id="linescaption" text="Lines" x="0" y="120" />
  44. </event>
  45. <event kind="user" id="scaleInitial" >
  46. <apply scope="basePaint" >
  47. <set field="linearText" to="true" dur="1" reset="true" />
  48. </apply>
  49. <apply scope="initialMatrix" >
  50. <animate field="scale" from="1" to=".5" dur="1"/>
  51. <animate field="translateX" from="120" to="60" dur="1"/>
  52. <animate field="translateY" from="100" to="60" dur="1"/>
  53. </apply>
  54. </event>
  55. <!--
  56. <event kind="keyChar" key="d" >
  57. <dump />
  58. </event>
  59. -->
  60. </screenplay>