Skip to content
This repository was archived by the owner on Nov 27, 2022. It is now read-only.

mteam/snippet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

mteam/snippet

This component draws a portion of image or canvas on another canvas. It is just a wrapper for canvas context drawImage function. It can be used in tilesheets or spritesheets.

API

new Snippet(object, x, y, width, height)

The first argument can be an image or a canvas that will be drawn.

var img = new Image();
var snip = new Snippet(img, 10, 10, 100, 100);

.draw(ctx, x, y)

var ctx = canvas.getContext('2d');
snip.draw(ctx, 50, 50);

About

This component draws a portion of image or canvas on another canvas

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors