layer.draggable.constraintsOffset < object>

Get the offset position of a layer, compared to its dragging contraints. If you set the dragging constraints to { x: 100, y: 100 }, the layer will still be initially positioned at x: 0, y: 0. After dragging, the layer will be bound to its dragging contraints. This offset can be measured with constraintsOffset.
译:获取层的偏移位置,相比其拖动约束上。如果您设置拖动约束{X:100,Y:100},该层仍然会首先定位在X:0,Y:0拖动后,图层将被绑定到其拖动约束上。该偏移可以与constraintsOffset进行测量。

layerA = new Layer
layerA.draggable.enabled = true

# Set dragging constraints 
layerA.draggable.constraints =
    x: 100
    y: 100
    width: 200
    height: 200

# Get the constraintsOffset 
print layerA.draggable.constraintsOffset

# Returns { x:-100, y:-100 }

results matching ""

    No results matching ""