CCreditsPanel.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.on("click", this._onLogoButRelease);
  29. _oContainer.addChild(_oHitArea);
  30. var oSprite = s_oSpriteLibrary.getSprite('but_exit');
  31. _pStartPosExit = {x: CANVAS_WIDTH/2 +264, y: 394};
  32. _oButExit = new CGfxButton(_pStartPosExit.x, _pStartPosExit.y, oSprite, _oContainer);
  33. _oButExit.addEventListener(ON_MOUSE_UP, this.unload, this);
  34. _oMsgText = new createjs.Text(TEXT_DEVELOPED,"46px "+PRIMARY_FONT, "#ffffff");
  35. _oMsgText.x = CANVAS_WIDTH/2;
  36. _oMsgText.y = 420;
  37. _oMsgText.textAlign = "center";
  38. _oContainer.addChild(_oMsgText);
  39. oSprite = s_oSpriteLibrary.getSprite('ctl_logo');
  40. var oLogo = createBitmap(oSprite);
  41. oLogo.regX = oSprite.width/2;
  42. oLogo.regY = oSprite.height/2;
  43. oLogo.x = CANVAS_WIDTH/2;
  44. oLogo.y = CANVAS_HEIGHT/2;
  45. _oContainer.addChild(oLogo);
  46. _oLink = new createjs.Text("movitel.co.mz","46px "+PRIMARY_FONT, "#ffffff");
  47. _oLink.x = CANVAS_WIDTH/2;
  48. _oLink.y = 570;
  49. _oLink.textAlign = "center";
  50. _oContainer.addChild(_oLink);
  51. };
  52. this.unload = function(){
  53. _oHitArea.off("click", this._onLogoButRelease);
  54. _oButExit.unload();
  55. _oButExit = null;
  56. s_oStage.removeChild(_oContainer);
  57. };
  58. this._onLogoButRelease = function(){
  59. window.open("https://movitel.co.mz/","_blank");
  60. };
  61. this._init();
  62. };