簡體   English   中英

與jcanvas一起移動兩層

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM