unitIcon.js 991 B

12345678910111213141516171819202122232425262728293031323334353637
  1. this.initialize = function() {
  2. if ( this.imageGenerator !== undefined ) {
  3. this.imageGenerator.imageRendered = this.events.add( function( img, iconSize, symbolCenter, symbolBounds ) {
  4. var mp = this.parent.mapPosition;
  5. this.image = img;
  6. this.size = iconSize;
  7. this.width = iconSize.width;
  8. this.height = iconSize.height;
  9. this.symbolCenter = symbolCenter;
  10. this.parent.mapPosition = mp;
  11. }, this );
  12. }
  13. }
  14. this.handleRender = function( img, iconSize, symbolCenter, symbolBounds ){
  15. var mp = this.parent.mapPosition;
  16. this.image = img;
  17. this.size = iconSize;
  18. this.width = iconSize.width;
  19. this.height = iconSize.height;
  20. this.symbolCenter = symbolCenter;
  21. this.parent.mapPosition = mp;
  22. if ( this.parent !== undefined ) {
  23. this.parent.handleRender( img, iconSize, symbolCenter, symbolBounds );
  24. }
  25. }
  26. //@ sourceURL=unitIcon.js