1.0.0 • Published 9 years ago

lb-screen-factory v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 years ago

lb-screen-factory

npm downloads Build Status Known Vulnerabilities js-standard-style

A screen factory function for using canvas

import screenFactory from 'lb-screen-factory'

const canvas = window.document.createElement('canvas')
const screen = screenFactory(canvas)

screen.setSize({
  width: 600,
  height: 400
})

const ctx = screen.getContext()

ctx.fillRect(0, 0, screen.getWidth(), screen.getHeight())