src/tile.js
function( container ) {
        if (!this.cacheImageRecord) {
            $.console.warn(
                '[Tile.drawHTML] attempting to draw tile %s when it\'s not cached',
                this.toString());
            return;
        }

        if ( !this.loaded ) {
            $.console.warn(
                "Attempting to draw tile %s when it's not yet loaded.",
                this.toString()
            );
            return;
        }

        //EXPERIMENTAL - trying to figure out how to scale the container
        //               content during animation of the container size.

        if ( !this.element ) {
            this.element                              = $.makeNeutralElement( "div" );
            this.imgElement                           = this.cacheImageRecord.getImage().cloneNode();
            this.imgElement.style.msInterpolationMode = "nearest-neighbor";
            this.imgElement.style.width               = "100%";
            this.imgElement.style.height              = "100%";

            this.style                     = this.element.style;
            this.style.position            = "absolute";
        }
        if ( this.element.parentNode != container ) {
            container.appendChild( this.element );
        }
        if ( this.imgElement.parentNode != this.element ) {
            this.element.appendChild( this.imgElement );
        }

        this.style.top     = this.position.y + "px";
        this.style.left    = this.position.x + "px";
        this.style.height  = this.size.y + "px";
        this.style.width   = this.size.x + "px";

        $.setElementOpacity( this.element, this.opacity );
    }
function( container ) {
        if (!this.cacheImageRecord) {
            $.console.warn(
                '[Tile.drawHTML] attempting to draw tile %s when it\'s not cached',
                this.toString());
            return;
        }

        if ( !this.loaded ) {
            $.console.warn(
                "Attempting to draw tile %s when it's not yet loaded.",
                this.toString()
            );
            return;
        }

        //EXPERIMENTAL - trying to figure out how to scale the container
        //               content during animation of the container size.

        if ( !this.element ) {
            this.element                              = $.makeNeutralElement( "div" );
            this.imgElement                           = this.cacheImageRecord.getImage().cloneNode();
            this.imgElement.style.msInterpolationMode = "nearest-neighbor";
            this.imgElement.style.width               = "100%";
            this.imgElement.style.height              = "100%";

            this.style                     = this.element.style;
            this.style.position            = "absolute";
        }
        if ( this.element.parentNode != container ) {
            container.appendChild( this.element );
        }
        if ( this.imgElement.parentNode != this.element ) {
            this.element.appendChild( this.imgElement );
        }

        this.style.top     = this.position.y + "px";
        this.style.left    = this.position.x + "px";
        this.style.height  = this.size.y + "px";
        this.style.width   = this.size.x + "px";

        $.setElementOpacity( this.element, this.opacity );
    }
function ( container ) { if ( ! this . cacheImageRecord ) { $ . console . warn ( '[Tile.drawHTML] attempting to draw tile %s when it\'s not cached' , this . toString ( ) ) ; return ; } if ( ! this . loaded ) { $ . console . warn ( "Attempting to draw tile %s when it's not yet loaded." , this . toString ( ) ) ; return ; } //EXPERIMENTAL - trying to figure out how to scale the container //               content during animation of the container size. if ( ! this . element ) { this . element = $ . makeNeutralElement ( "div" ) ; this . imgElement = this . cacheImageRecord . getImage ( ) . cloneNode ( ) ; this . imgElement . style . msInterpolationMode = "nearest-neighbor" ; this . imgElement . style . width = "100%" ; this . imgElement . style . height = "100%" ; this . style = this . element . style ; this . style . position = "absolute" ; } if ( this . element . parentNode != container ) { container . appendChild ( this . element ) ; } if ( this . imgElement . parentNode != this . element ) { this . element . appendChild ( this . imgElement ) ; } this . style . top = this . position . y + "px" ; this . style . left = this . position . x + "px" ; this . style . height = this . size . y + "px" ; this . style . width = this . size . x + "px" ; $ . setElementOpacity ( this . element , this . opacity ) ; }
Renders the tile in an html container.
@function
@param {Element} container
Renders the tile in an html container .