CPole.js 595 B

123456789101112131415161718192021222324252627282930
  1. function CPole(iX, iY, oSprite, oParentContainer) {
  2. var _oPole;
  3. var _oParentContainer = oParentContainer;
  4. this._init = function (iX, iY, oSprite) {
  5. _oPole = createBitmap(oSprite);
  6. _oPole.x = iX;
  7. _oPole.y = iY;
  8. _oPole.regX = oSprite.width * 0.5;
  9. _oPole.regY = oSprite.height * 0.5;
  10. _oParentContainer.addChild(_oPole);
  11. };
  12. this.getValue = function () {
  13. return _oPole;
  14. };
  15. this.unload = function () {
  16. _oParentContainer.removeChild(_oPole);
  17. };
  18. this._init(iX, iY, oSprite);
  19. return this;
  20. }