So I am trying to build a game with pixel art in html using jCanvas. However, when I try to disable imageSmoothing in order to leave the pixels sharp, nothing happens.
$(function() {
$('canvas').drawImage({
source: 'http://i.imgur.com/Y2o59.png',
x:400, y:250,
width: 160, height: 160,
imageSmoothingEnabled: false,
});
});
Edit: Added random piece of pixel art to make it easier to test.
Figured it out.
First of all, its imageSmoothing: false, not imageSmoothingEnabled: false. Second, you still need to enable smoothing on the context, like this:
There, no smoothing.