lundi 29 juin 2015

JCanvas restrict drag-and-drop layer for only right click

I'm using JCanvas for my isometric game. How to restrict the draggable layers to work only with the right mouse button?

So I would like to drag-and-drop my layer only with the right mouse button.

My render code is:

$c.drawImage({
    layer: true,
    groups: ['terrain'],
    dragGroups: ['terrain'],
    source: 'img/tileset.png',
    x: x_pos, y: y_pos,
    sWidth: 64,
    sHeight: 32,
    sx: map[x][y]*64, sy: 0
});

Aucun commentaire:

Enregistrer un commentaire