- Load the source image of the tile sheet in the canvas via
new Image()
- Specify the X and Y position of the source image on the canvas
- Specify the width and height of the source image (i.e. tile sheet)
- Use
SpriteConfiguration
to specify the source and destination coordinates of the source image and the resulting sprite image on the canvas (see thecanvas.drawImage
method) - Provide the
SpriteConfiguration
objects to theSprite
constructor. These methods provide the positional arguments for thecanvas.drawImage
method in the correct order returning them as an array.
-
Notifications
You must be signed in to change notification settings - Fork 0
seanttaylor/hello-html5-canvas
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Learning project focused on getting up and running with the HTML5 Canvas API
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published