       canvas.fillColor(I.color)
       canvas.fillRect(0, 0, I.width, I.height)
 
+  return {}
+

object.

Binds a default draw listener to draw a rectangle or a sprite, if one exists.

Autoloads the sprite specified in I.spriteName, if any.



  self.bind 'step', ->
    center = self.center()

    if I.rotation
      I.transform = Matrix.translation(center.x, center.y)
        .concat(Matrix.rotation(I.rotation)) if I.rotation
        .concat(Matrix.translation(-I.width/2, -I.height/2))
    else
      # Assumes I.x and I.y are top-left
      I.transform = Matrix.translation(I.x, I.y)

  self.bind 'draw', (canvas) ->
    if I.sprite
