ig.

Image

new Image()

Fixes and enhancements for images.

Author:
  • Collin Hover - collinhover.com
Source:

data :Canvas

Current image data after resizing.
- created on load and recreated on each resize

Source:

dataContext :CanvasRenderingContext2D

Context of Current image data after resizing.
- created on load and recreated on each resize

Source:

dataHeight :Number

Height of current image.
- this value is set calculated based on ig.ImageDrawing#height and ig.ImageDrawing#scale

Source:

dataWidth :Number

Width of current image.
- this value is set calculated based on ig.ImageDrawing#width and ig.ImageDrawing#scale

Source:

height :Number

Height of unscaled drawing.

Default Value:
  • 1
Source:

ignoreSystemScale :Boolean

If image should ignore system scale. Tip: because pixel perfect scaling is so performance intensive, try to ignore scale whenever possible.

Default Value:
  • false
Source:

onLoaded :ig.Signal

Signal dispatched when image finishes loading.
- created on init.

Source:

retainScaledData :Boolean

Whether image should retain copies of data when scale is not 1. Tip: this is best used when an image is used by multiple entities requesting drawing at different scales.

Default Value:
  • true
Source:

scale :Number

Scale of current image.
- will automatically copy system scale unless is ignoring system scale due to ig.ImageDrawing#ignoreSystemScale

Default Value:
  • 1
Source:

scaleCache :Object

Copies of data at various scales.
- created on init. Tip: data is mapped by scale, and 1 always refers to the original image data.

Default Value:
  • null
Source:

scaleMax :Number

Maximum value of ig.Image#scale.

Source:

scaleMin :Number

Minimum value of ig.Image#scale.

Default Value:
  • 1
Source:

scaleOfSystemScale :Number

Scale of system scale.

Default Value:
  • 1
Source:

width :Number

Width of unscaled drawing.

Default Value:
  • 1
Source:

draw(targetX, targetY, sourceX, sourceY, width, height, scale)

Draws image into system context, accounting for system scale changes.

Parameters:
Name Type Description
targetX Number
targetY Number
sourceX Number
sourceY Number
width Number
height Number
scale Number
Source:

drawTile(targetX, targetY, tile, tileWidth, tileHeight, flipX, flipY, scale)

Draws image tile into system.

Parameters:
Name Type Description
targetX Number
targetY Number
tile Number
tileWidth Number
tileHeight Number
flipX Boolean
flipY Boolean
scale Number
Source:

init(settings)

Initializes image and begins loading path.

Parameters:
Name Type Description
settings Object settings object.
Source:

onload()

Source:

resize()

Source: