CPanel.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. function CPanel(iScore){
  2. var _oBg;
  3. var _oGroup;
  4. var _oMsgText;
  5. var _oMsgText1;
  6. var _oMsgText2;
  7. var _oMsgText3;
  8. var _oScoreText;
  9. var _oScoreText1;
  10. this._init = function(iScore){
  11. _oBg = createBitmap(s_oSpriteLibrary.getSprite("msg_box"));
  12. _oMsgText = new createjs.Text(TEXT_PANEL," 60px "+FONT2, "#ffffff");
  13. _oMsgText.x = CANVAS_WIDTH/2;
  14. _oMsgText.y = (CANVAS_HEIGHT/2-50);
  15. _oMsgText.textAlign = "center";
  16. _oMsgText.textBaseline = "alphabetic";
  17. _oMsgText.lineWidth = 450;
  18. _oMsgText.lineHeight = 60;
  19. _oMsgText.outline = 5;
  20. _oMsgText1 = new createjs.Text(TEXT_PANEL," 60px "+FONT2, "#ff0000");
  21. _oMsgText1.x = CANVAS_WIDTH/2;
  22. _oMsgText1.y = (CANVAS_HEIGHT/2-50);
  23. _oMsgText1.textAlign = "center";
  24. _oMsgText1.textBaseline = "alphabetic";
  25. _oMsgText1.lineWidth = 450;
  26. _oMsgText1.lineHeight = 60;
  27. _oScoreText = new createjs.Text(iScore," 60px "+FONT2, "#ffffff");
  28. _oScoreText.x = CANVAS_WIDTH/2-50;
  29. _oScoreText.y = (CANVAS_HEIGHT/2) + 80;
  30. _oScoreText.textAlign = "right";
  31. _oScoreText.textBaseline = "alphabetic";
  32. _oScoreText.lineWidth = 500;
  33. _oScoreText.outline = 5;
  34. _oScoreText1 = new createjs.Text(iScore," 60px "+FONT2, "#ff0000");
  35. _oScoreText1.x = CANVAS_WIDTH/2-50;
  36. _oScoreText1.y = (CANVAS_HEIGHT/2) + 80;
  37. _oScoreText1.textAlign = "right";
  38. _oScoreText1.textBaseline = "alphabetic";
  39. _oScoreText1.lineWidth = 500;
  40. _oMsgText2 = new createjs.Text(TEXT_PANEL_POINT," 60px "+FONT2, "#ffffff");
  41. _oMsgText2.x = CANVAS_WIDTH/2+30;
  42. _oMsgText2.y = (CANVAS_HEIGHT/2+80);
  43. _oMsgText2.textAlign = "center";
  44. _oMsgText2.textBaseline = "alphabetic";
  45. _oMsgText2.lineWidth = 500;
  46. _oMsgText2.outline = 5;
  47. _oMsgText3 = new createjs.Text(TEXT_PANEL_POINT," 60px "+FONT2, "#ff0000");
  48. _oMsgText3.x = CANVAS_WIDTH/2+30;
  49. _oMsgText3.y = (CANVAS_HEIGHT/2+80);
  50. _oMsgText3.textAlign = "center";
  51. _oMsgText3.textBaseline = "alphabetic";
  52. _oMsgText3.lineWidth = 500;
  53. _oGroup = new createjs.Container();
  54. _oGroup.alpha = 0;
  55. _oGroup.addChild(_oBg, _oMsgText, _oScoreText, _oScoreText1, _oMsgText1, _oMsgText2, _oMsgText3);
  56. s_oStage.addChild(_oGroup);
  57. this.show();
  58. };
  59. this._initListener = function(){
  60. _oGroup.on("mousedown",this._onExit);
  61. };
  62. this.show = function(){
  63. _oGroup.visible = true;
  64. var oParent = this;
  65. createjs.Tween.get( _oGroup ).to({alpha: 1 }, (500), createjs.Ease.cubicOut).call(function() {oParent._initListener();});
  66. };
  67. this._onExit = function(){
  68. _oGroup.off("mousedown",this._onExit);
  69. s_oStage.removeChild(_oGroup);
  70. s_oGame._restart();
  71. };
  72. this._init(iScore);
  73. return this;
  74. }