[英]move two layers together with jcanvas
使用jcanvas ,我如何鏈接兩個可拖動層,使它們一起移動。
例如。 圓圈和文檔圖標是兩個差異層。 我怎么有他們
a)在同一層上繪制或
b)一起移動
// document
.drawArc({
layer: true,
groups: ['document'],
fillStyle: 'yellow',
x: 100, y: 250,
radius: 50
})
.drawImage({
groups: ['document'],
source: "img/document.jpg",
x: 100, y: 250,
width:40, height: 40,
layer: true
})
$('canvas').setLayerGroup('document', {
draggable: true,
bringToFront: true
})
您可以使用dragGroups:[]
在這里編碼
$('canvas').drawArc({
layer: true,
groups: ['document'],
dragGroups: ['document'],
draggable: true,
fillStyle: 'yellow',
x: 100, y: 250,
radius: 50
})
.drawImage({
groups: ['document'],
dragGroups: ['document'],
draggable: true,
source: "img/document.jpg",
x: 100, y: 250,
width: 40, height: 40,
layer: true
}).drawLayers();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.