about.m 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /*---------------------------------------------------
  2. -----------------------------------------------------
  3. Filename: about.m
  4. Version: 1.0
  5. Type: maki
  6. Date: 03. Jul. 2006 - 22:40
  7. Author: Martin Poehlmann aka Deimos
  8. E-Mail: [email protected]
  9. Internet: www.skinconsortium.com
  10. www.martin.deimos.de.vu
  11. -----------------------------------------------------
  12. ---------------------------------------------------*/
  13. #include <lib/std.mi>
  14. #include nibbles/nibbles.m
  15. Global Layer tgnibbles;
  16. Global Group sg;
  17. Global Timer change;
  18. Global int counter;
  19. Global Group g1, g2, g3, g4, g5, g6, g7, g8;
  20. Function blend (guiobject in, guiobject out);
  21. System.onScriptLoaded ()
  22. {
  23. sg = getScriptGroup();
  24. tgnibbles = sg.getObject("toggle");
  25. nibbles = sg.getObject("nibbles");
  26. init_nibbles();
  27. g1 = sg.getObject("about.text1");
  28. g2 = sg.getObject("about.text2");
  29. g3 = sg.getObject("about.text3");
  30. g4 = sg.getObject("about.text4");
  31. g5 = sg.getObject("about.text5");
  32. g6 = sg.getObject("about.text6");
  33. g7 = sg.getObject("about.text7");
  34. g8 = sg.getObject("about.text8");
  35. change = new Timer;
  36. change.setDelay(3300);
  37. }
  38. system.onScriptUnloading ()
  39. {
  40. delete change;
  41. }
  42. tgnibbles.onLeftButtonDblClk (int x, int y)
  43. {
  44. if (nibbles.isVisible()) nibbles.hide();
  45. else if (!nibbles.isVisible()) nibbles.show();
  46. }
  47. sg.onSetVisible (Boolean onoff)
  48. {
  49. if (onoff)
  50. {
  51. change.start();
  52. g1.setXmlParam("x", "400");
  53. g1.canceltarget();
  54. g1.setAlpha(255);
  55. g1.setTargetX(25);
  56. g1.setTargetSpeed(1.3);
  57. g1.gotoTarget();
  58. }
  59. else
  60. {
  61. change.stop();
  62. }
  63. }
  64. change.onTimer ()
  65. {
  66. counter++;
  67. if (counter > 7) counter = 0;
  68. if (counter == 0)
  69. {
  70. blend(g1, g8);
  71. }
  72. else if (counter == 1)
  73. {
  74. blend(g2, g1);
  75. }
  76. else if (counter == 2)
  77. {
  78. blend(g3, g2);
  79. }
  80. else if (counter == 3)
  81. {
  82. blend(g4, g3);
  83. }
  84. else if (counter == 4)
  85. {
  86. blend(g5, g4);
  87. }
  88. else if (counter == 5)
  89. {
  90. blend(g6, g5);
  91. }
  92. else if (counter == 6)
  93. {
  94. blend(g7, g6);
  95. }
  96. else if (counter == 7)
  97. {
  98. blend(g8, g7);
  99. }
  100. }
  101. blend (guiobject in, guiobject out)
  102. {
  103. out.canceltarget();
  104. out.setTargetA(0);
  105. out.setTargetX(-25);
  106. out.setTargetSpeed(2);
  107. out.gotoTarget();
  108. in.canceltarget();
  109. in.setXmlParam("x", "400");
  110. in.setAlpha(255);
  111. in.setTargetX(25);
  112. in.setTargetA(255);
  113. in.setTargetSpeed(1.5);
  114. in.gotoTarget();
  115. }