CCreditsPanel.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. function CCreditsPanel() {
  2. var _oBg;
  3. var _oButExit;
  4. var _oMsgText;
  5. var _oFade;
  6. var _oHitArea;
  7. var _oLink;
  8. var _oContainer;
  9. var _pStartPosExit;
  10. this._init = function () {
  11. _oContainer = new createjs.Container();
  12. s_oStage.addChild(_oContainer);
  13. var oBgMenu = createBitmap(s_oSpriteLibrary.getSprite('bg_menu'));
  14. _oContainer.addChild(oBgMenu);
  15. _oFade = new createjs.Shape();
  16. _oFade.graphics.beginFill("rgba(0,0,0,0.7)").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);
  17. _oContainer.addChild(_oFade);
  18. var oSprite = s_oSpriteLibrary.getSprite('msg_box');
  19. _oBg = createBitmap(oSprite);
  20. _oBg.x = CANVAS_WIDTH / 2;
  21. _oBg.y = CANVAS_HEIGHT / 2;
  22. _oBg.regX = oSprite.width / 2;
  23. _oBg.regY = oSprite.height / 2;
  24. _oContainer.addChild(_oBg);
  25. _oHitArea = new createjs.Shape();
  26. _oHitArea.graphics.beginFill("#0f0f0f").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);
  27. _oHitArea.alpha = 0.01;
  28. _oHitArea.cursor="pointer";
  29. _oHitArea.on("click", this._onLogoButRelease);
  30. _oContainer.addChild(_oHitArea);
  31. var oSprite = s_oSpriteLibrary.getSprite('but_exit');
  32. _pStartPosExit = {x: CANVAS_WIDTH / 2 + 204, y: 264};
  33. _oButExit = new CGfxButton(_pStartPosExit.x, _pStartPosExit.y, oSprite, _oContainer);
  34. _oButExit.addEventListener(ON_MOUSE_UP, this.unload, this);
  35. _oMsgText = new createjs.Text(TEXT_CREDITS_DEVELOPED, "48px " + FONT2, "#ffffff");
  36. _oMsgText.x = CANVAS_WIDTH / 2;
  37. _oMsgText.y = 350;
  38. _oMsgText.textAlign = "center";
  39. _oContainer.addChild(_oMsgText);
  40. oSprite = s_oSpriteLibrary.getSprite('logo_credits');
  41. var oLogo = createBitmap(oSprite);
  42. oLogo.regX = oSprite.width / 2;
  43. oLogo.regY = oSprite.height / 2;
  44. oLogo.x = CANVAS_WIDTH / 2;
  45. oLogo.y = 470;
  46. _oContainer.addChild(oLogo);
  47. _oLink = new createjs.Text(TEXT_LINK, "42px " + FONT2, "#ffffff");
  48. _oLink.x = CANVAS_WIDTH / 2;
  49. _oLink.y = 530;
  50. _oLink.textAlign = "center";
  51. _oContainer.addChild(_oLink);
  52. };
  53. this.unload = function () {
  54. _oHitArea.off("click", this._onLogoButRelease);
  55. _oButExit.unload();
  56. _oButExit = null;
  57. s_oStage.removeChild(_oContainer);
  58. };
  59. this._onLogoButRelease = function () {
  60. window.open("http://movitel.co.mz");
  61. };
  62. this._init();
  63. }
  64. ;