CCreditsPanel.js 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. function CCreditsPanel() {
  2. var _oBg;
  3. var _oButLogo;
  4. var _oButExit;
  5. var _oMsgText;
  6. var _oHitArea;
  7. var _oListener;
  8. var _oLink;
  9. var _pStartPosExit;
  10. var _oContainer;
  11. this._init = function () {
  12. _oContainer = new createjs.Container();
  13. s_oStage.addChild(_oContainer);
  14. var oSpriteBg = s_oSpriteLibrary.getSprite('msg_box');
  15. _oHitArea = new createjs.Shape();
  16. _oHitArea.graphics.beginFill("#000").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);
  17. _oHitArea.alpha = 0.8;
  18. _oListener = _oHitArea.on("click", this._onLogoButRelease);
  19. _oHitArea.cursor = "pointer";
  20. _oContainer.addChild(_oHitArea);
  21. _oBg = createBitmap(oSpriteBg);
  22. _oBg.x = CANVAS_WIDTH_HALF;
  23. _oBg.y = CANVAS_HEIGHT_HALF + 95;
  24. _oBg.regX = oSpriteBg.width * 0.5;
  25. _oBg.regY = oSpriteBg.height * 0.5;
  26. _oContainer.addChild(_oBg);
  27. var oSprite = s_oSpriteLibrary.getSprite('but_exit');
  28. _pStartPosExit = {x: CANVAS_WIDTH * 0.5 + 205, y: 593};
  29. _oButExit = new CGfxButton(_pStartPosExit.x, _pStartPosExit.y, oSprite, _oContainer);
  30. _oButExit.addEventListener(ON_MOUSE_UP, this.unload, this);
  31. _oMsgText = new createjs.Text(TEXT_CREDITS_DEVELOPED, "42px " + SECONDARY_FONT, "#ffffff");
  32. _oMsgText.textAlign = "center";
  33. _oMsgText.textBaseline = "alphabetic";
  34. _oMsgText.x = CANVAS_WIDTH / 2;
  35. _oMsgText.y = CANVAS_HEIGHT_HALF - 50;
  36. _oContainer.addChild(_oMsgText);
  37. oSprite = s_oSpriteLibrary.getSprite('logo_ctl');
  38. _oButLogo = createBitmap(oSprite);
  39. _oButLogo.regX = oSprite.width / 2;
  40. _oButLogo.regY = oSprite.height / 2;
  41. _oButLogo.x = CANVAS_WIDTH / 2;
  42. _oButLogo.y = CANVAS_HEIGHT_HALF + 25;
  43. _oContainer.addChild(_oButLogo);
  44. _oLink = new createjs.Text(TEXT_LINK1, "42px " + SECONDARY_FONT, "#ffffff");
  45. _oLink.textAlign = "center";
  46. _oLink.textBaseline = "alphabetic";
  47. _oLink.x = CANVAS_WIDTH / 2;
  48. _oLink.y = _oButLogo.y + 100;
  49. _oContainer.addChild(_oLink);
  50. };
  51. this.unload = function () {
  52. _oHitArea.off("click", _oListener);
  53. _oButExit.unload();
  54. _oButExit = null;
  55. s_oStage.removeChild(_oContainer);
  56. };
  57. this._onLogoButRelease = function () {
  58. window.open("http://movitel.co.mz", "_blank");
  59. };
  60. this._init();
  61. }