Home / Topic / Drag, lock, scaling issue

Drag, lock, scaling issue

Home Kwiksher Forums Kwik 3 Bugs Drag, lock, scaling issue

Viewing 7 posts - 1 through 7 (of 7 total)
  • Fionnuala
    Participant
    #83753

    Hi Yamamoto,

    I am having an issue with scaling and the drag feature. I want to drag an object with the action (using the edit image feature) to scale it 110% while it is dragged and another action (again using the edit image feature) when the drag is released to bring it back to 100%

    This is working fine some of the time with some layers, but with other layers the image is flipped vertically (I have not checked this button in the edit layer feature) when the image is locked.

    The drag works fine on these layers if I don’t use the scaling action, but as soon as I add the scaling actions the image is flipped – on some layers, but not others.

    Any help on this would be great.

    Thanks a million

    Fionnuala

    Yamamoto
    Keymaster
    #83755

    it could be the same issue about gtween http://kwiksher.com/forums/topic/flip-x-and-flip-y-on-reverse/#post-83629
    or the parameters to gtween are not correctly set by kwik generated codes. I will check scaling and dragging and come back to report a result

    Fionnuala
    Participant
    #83771

    Thanks Yamamoto

    I have had a look at the code, but I cannot figure out the issue. If this helps, here is the code, thanks:

    — Code created by Kwik – Copyright: kwiksher.com
    — Version: 3.3.9
    — Project: Paper_Play, published on Thu May 07 2015 16:33:21 GMT+0100
    local composer = require( “composer” )
    local scene = composer.newScene()

    — External libraries

    — Initial settings and checkings
    local numPages = 1 — number of pages in the project
    local sceneGroup = nil — main group for all page elements
    local W = display.contentWidth; — full width of the page
    local H = display.contentHeight; — full height of the page

    local curPage = 1 — number of the current page

    — Action names
    local act_dropwing
    local act_scalewing
    local act_scalebody
    local act_dropbody
    math.randomseed(os.time())

    — All layers on a table
    local layer = {}

    — All audio files on a table
    local allAudios = {}
    allAudios.kAutoPlay = composer.kAutoPlay

    — Calculates anchor points
    local function repositionAnchor( object, newAnchorX, newAnchorY )
    local origX = object.x; local origY = object.y
    if newAnchorX ~= 0.5 or newAnchorY ~= 0.5 then
    local width = object.width; local height = object.height
    local xCoord = width * (newAnchorX – .5)
    local yCoord = height * (newAnchorY – .5)
    object.x = origX + xCoord; object.y = origY + yCoord
    object.oriX = object.x; object.oriY = object.y
    end
    end

    — Called when the scene’s view does not exist:
    function scene:create( event )
    — view is not yet visible
    local sceneGroup = self.view

    — Capture and set group position
    local function groupPos(obj)
    local minX, minY
    for i = 1, obj.numChildren do
    local currentRecord = obj[ i ]
    if i == 1 then
    minX = currentRecord.x – currentRecord.contentWidth * 0.5
    minY = currentRecord.y – currentRecord.contentHeight * 0.5
    end
    local mX = currentRecord.x – currentRecord.contentWidth * 0.5
    if mX < minX then
    minX = mX
    end
    local mY = currentRecord.y – currentRecord.contentHeight * 0.5
    if mY < minY then
    minY = mY
    end
    end
    obj.x = minX + obj.contentWidth * 0.5
    obj.y = minY + obj.contentHeight * 0.5
    end

    — Multilingual items

    — (TOP) External code will render here

    — BG positioning
    layer.BG = display.newImageRect( composer.imgDir.. “p1_bg.png”, 2050, 1540 );
    layer.BG.x = 1025; layer.BG.y = 770; layer.BG.alpha = 1; layer.BG.oldAlpha = 1
    layer.BG.oriX = layer.BG.x; layer.BG.oriY = layer.BG.y
    layer.BG.oriXs = layer.BG.xScale; layer.BG.oriYs = layer.BG.yScale
    layer.BG.name = “BG”
    sceneGroup:insert( 1, layer.BG); sceneGroup.BG = layer.BG

    — BodyShape positioning
    layer.BodyShape = display.newImageRect( composer.imgDir.. “p1_bodyshape.png”, 863, 426 );
    layer.BodyShape.x = 959; layer.BodyShape.y = 658; layer.BodyShape.alpha = 0.74901960784314; layer.BodyShape.oldAlpha = 0.74901960784314
    layer.BodyShape.oriX = layer.BodyShape.x; layer.BodyShape.oriY = layer.BodyShape.y
    layer.BodyShape.oriXs = layer.BodyShape.xScale; layer.BodyShape.oriYs = layer.BodyShape.yScale
    layer.BodyShape.name = “BodyShape”
    sceneGroup:insert( layer.BodyShape); sceneGroup.BodyShape = layer.BodyShape

    — WingShape positioning
    layer.WingShape = display.newImageRect( composer.imgDir.. “p1_wingshape.png”, 707, 264 );
    layer.WingShape.x = 758; layer.WingShape.y = 702; layer.WingShape.alpha = 0.74901960784314; layer.WingShape.oldAlpha = 0.74901960784314
    layer.WingShape.oriX = layer.WingShape.x; layer.WingShape.oriY = layer.WingShape.y
    layer.WingShape.oriXs = layer.WingShape.xScale; layer.WingShape.oriYs = layer.WingShape.yScale
    layer.WingShape.name = “WingShape”
    sceneGroup:insert( layer.WingShape); sceneGroup.WingShape = layer.WingShape

    — BeakShape positioning
    layer.BeakShape = display.newImageRect( composer.imgDir.. “p1_beakshape.png”, 109, 116 );
    layer.BeakShape.x = 1428; layer.BeakShape.y = 657; layer.BeakShape.alpha = 1; layer.BeakShape.oldAlpha = 1
    layer.BeakShape.oriX = layer.BeakShape.x; layer.BeakShape.oriY = layer.BeakShape.y
    layer.BeakShape.oriXs = layer.BeakShape.xScale; layer.BeakShape.oriYs = layer.BeakShape.yScale
    layer.BeakShape.name = “BeakShape”
    sceneGroup:insert( layer.BeakShape); sceneGroup.BeakShape = layer.BeakShape

    — LegLShape positioning
    layer.LegLShape = display.newImageRect( composer.imgDir.. “p1_leglshape.png”, 150, 200 );
    layer.LegLShape.x = 960; layer.LegLShape.y = 932; layer.LegLShape.alpha = 0.74901960784314; layer.LegLShape.oldAlpha = 0.74901960784314
    layer.LegLShape.oriX = layer.LegLShape.x; layer.LegLShape.oriY = layer.LegLShape.y
    layer.LegLShape.oriXs = layer.LegLShape.xScale; layer.LegLShape.oriYs = layer.LegLShape.yScale
    layer.LegLShape.name = “LegLShape”
    sceneGroup:insert( layer.LegLShape); sceneGroup.LegLShape = layer.LegLShape

    — LegRShape positioning
    layer.LegRShape = display.newImageRect( composer.imgDir.. “p1_legrshape.png”, 150, 136 );
    layer.LegRShape.x = 1110; layer.LegRShape.y = 926; layer.LegRShape.alpha = 0.74901960784314; layer.LegRShape.oldAlpha = 0.74901960784314
    layer.LegRShape.oriX = layer.LegRShape.x; layer.LegRShape.oriY = layer.LegRShape.y
    layer.LegRShape.oriXs = layer.LegRShape.xScale; layer.LegRShape.oriYs = layer.LegRShape.yScale
    layer.LegRShape.name = “LegRShape”
    sceneGroup:insert( layer.LegRShape); sceneGroup.LegRShape = layer.LegRShape

    — BodyJigsaw positioning
    layer.BodyJigsaw = display.newImageRect( composer.imgDir.. “p1_bodyjigsaw.png”, 861, 425 );
    layer.BodyJigsaw.x = 894; layer.BodyJigsaw.y = 1315; layer.BodyJigsaw.alpha = 1; layer.BodyJigsaw.oldAlpha = 1
    layer.BodyJigsaw.oriX = layer.BodyJigsaw.x; layer.BodyJigsaw.oriY = layer.BodyJigsaw.y
    layer.BodyJigsaw.oriXs = layer.BodyJigsaw.xScale; layer.BodyJigsaw.oriYs = layer.BodyJigsaw.yScale
    layer.BodyJigsaw.name = “BodyJigsaw”
    sceneGroup:insert( layer.BodyJigsaw); sceneGroup.BodyJigsaw = layer.BodyJigsaw

    — LegLJigsaw positioning
    layer.LegLJigsaw = display.newImageRect( composer.imgDir.. “p1_legljigsaw.png”, 150, 199 );
    layer.LegLJigsaw.x = 199; layer.LegLJigsaw.y = 1396; layer.LegLJigsaw.alpha = 1; layer.LegLJigsaw.oldAlpha = 1
    layer.LegLJigsaw.oriX = layer.LegLJigsaw.x; layer.LegLJigsaw.oriY = layer.LegLJigsaw.y
    layer.LegLJigsaw.oriXs = layer.LegLJigsaw.xScale; layer.LegLJigsaw.oriYs = layer.LegLJigsaw.yScale
    layer.LegLJigsaw.name = “LegLJigsaw”
    sceneGroup:insert( layer.LegLJigsaw); sceneGroup.LegLJigsaw = layer.LegLJigsaw

    — LegRJigsaw positioning
    layer.LegRJigsaw = display.newImageRect( composer.imgDir.. “p1_legrjigsaw.png”, 150, 136 );
    layer.LegRJigsaw.x = 441; layer.LegRJigsaw.y = 1418; layer.LegRJigsaw.alpha = 1; layer.LegRJigsaw.oldAlpha = 1
    layer.LegRJigsaw.oriX = layer.LegRJigsaw.x; layer.LegRJigsaw.oriY = layer.LegRJigsaw.y
    layer.LegRJigsaw.oriXs = layer.LegRJigsaw.xScale; layer.LegRJigsaw.oriYs = layer.LegRJigsaw.yScale
    layer.LegRJigsaw.name = “LegRJigsaw”
    sceneGroup:insert( layer.LegRJigsaw); sceneGroup.LegRJigsaw = layer.LegRJigsaw

    — BeakJigsaw positioning
    layer.BeakJigsaw = display.newImageRect( composer.imgDir.. “p1_beakjigsaw.png”, 108, 115 );
    layer.BeakJigsaw.x = 677; layer.BeakJigsaw.y = 1393; layer.BeakJigsaw.alpha = 1; layer.BeakJigsaw.oldAlpha = 1
    layer.BeakJigsaw.oriX = layer.BeakJigsaw.x; layer.BeakJigsaw.oriY = layer.BeakJigsaw.y
    layer.BeakJigsaw.oriXs = layer.BeakJigsaw.xScale; layer.BeakJigsaw.oriYs = layer.BeakJigsaw.yScale
    layer.BeakJigsaw.name = “BeakJigsaw”
    sceneGroup:insert( layer.BeakJigsaw); sceneGroup.BeakJigsaw = layer.BeakJigsaw

    — WingJigsaw positioning
    layer.WingJigsaw = display.newImageRect( composer.imgDir.. “p1_wingjigsaw.png”, 707, 264 );
    layer.WingJigsaw.x = 1697; layer.WingJigsaw.y = 1319; layer.WingJigsaw.alpha = 1; layer.WingJigsaw.oldAlpha = 1
    layer.WingJigsaw.oriX = layer.WingJigsaw.x; layer.WingJigsaw.oriY = layer.WingJigsaw.y
    layer.WingJigsaw.oriXs = layer.WingJigsaw.xScale; layer.WingJigsaw.oriYs = layer.WingJigsaw.yScale
    layer.WingJigsaw.name = “WingJigsaw”
    sceneGroup:insert( layer.WingJigsaw); sceneGroup.WingJigsaw = layer.WingJigsaw

    — Group(s) creation

    — (MIDDLE) External code will render here

    — Repositions according anchor points

    end — ends scene:create

    — Called when the scene’s view is about to ‘will/load’ or ‘did/appear’:
    function scene:show( event )
    local sceneGroup = self.view

    if event.phase == “did” then
    — purges previous and next scenes
    if nil~= composer.getScene(“page_2”) then composer.removeScene(“page_2”, true) end

    — Check for previous bookmarks
    if (tonumber(composer.kBookmark) == 1) then
    local path = system.pathForFile( “book.txt”, system.DocumentsDirectory )
    local file = io.open( path, “w+” )
    file:write ( curPage..”\n1″ )
    io.close( file )
    end

    — Check for for auto play settings
    if (tonumber(composer.kAutoPlay) > 0) then
    local function act_autoPlay(event)
    if(curPage < numPages) then
    if(composer.kBidi == false) then
    composer.gotoScene( “page_”..curPage+1, { effect = “fromRight”} )
    else
    composer.gotoScene( “page_”..curPage-1, { effect = “fromLeft”} )
    end
    end
    end
    if (tonumber(allAudios.kAutoPlay) > composer.kAutoPlay) then
    composer.timerStash.timer_AP = timer.performWithDelay( allAudios.kAutoPlay*1000, act_autoPlay, 1 )
    else
    composer.timerStash.timer_AP = timer.performWithDelay( composer.kAutoPlay*1000, act_autoPlay, 1 )
    end
    end

    — Actions (functions)
    act_dropwing = function (event)
    layer.WingJigsaw.xScale = -1
    layer.WingJigsaw.yScale = -1
    layer.WingJigsaw.rotation = 0
    end

    act_scalewing = function (event)
    layer.WingJigsaw.xScale = 1.1
    layer.WingJigsaw.yScale = 1.1
    layer.WingJigsaw.rotation = 0
    end

    act_scalebody = function (event)
    layer.BodyJigsaw.xScale = 1.1
    layer.BodyJigsaw.yScale = 1.1
    layer.BodyJigsaw.rotation = 0
    end

    act_dropbody = function (event)
    layer.BodyJigsaw.xScale = -1
    layer.BodyJigsaw.yScale = -1
    layer.BodyJigsaw.yScale = layer.BodyJigsaw.yScale * -1
    layer.BodyJigsaw.rotation = 0
    end

    –End Actions (functions)

    — Drag objects
    composer.MultiTouch.activate( layer.WingJigsaw, “move”, “single” )
    local WingJigsaw_lock = 0
    local WingJigsaw_posX = 0; local WingJigsaw_posY = 0;
    composer.WingJigsawDrag = function (event )
    local t = event.target
    if event.phase == “began” then
    local parent = t.parent; parent:insert(t); display.getCurrentStage():setFocus(t); t.isFocus = true
    elseif event.phase == “moved” then
    WingJigsaw_posX = layer.WingJigsaw.x – layer.WingShape.x
    WingJigsaw_posY = layer.WingJigsaw.y – layer.WingShape.y
    if (WingJigsaw_posX < 0) then
    WingJigsaw_posX = WingJigsaw_posX * -1
    end
    if (WingJigsaw_posY < 0) then
    WingJigsaw_posY = WingJigsaw_posY * -1
    end
    if (WingJigsaw_posX <= 50) and (WingJigsaw_posY <= 50) then –in position
    layer.WingJigsaw.x = layer.WingShape.x
    layer.WingJigsaw.y = layer.WingShape.y
    WingJigsaw_lock = 1
    else
    WingJigsaw_lock = 0
    end
    act_scalewing()
    elseif event.phase == “ended” or event.phase == “cancelled” then
    if (WingJigsaw_lock == 1 and WingJigsaw_posX <= 50) and (WingJigsaw_posY <= 50) then
    layer.WingJigsaw.x = layer.WingShape.x
    layer.WingJigsaw.y = layer.WingShape.y
    composer.MultiTouch.deactivate(layer.WingJigsaw)
    else
    layer.WingJigsaw.x = layer.WingJigsaw.oriX
    layer.WingJigsaw.y = layer.WingJigsaw.oriY
    end
    act_dropwing()
    display.getCurrentStage():setFocus(nil); t.isFocus = false
    end
    return true
    end
    layer.WingJigsaw:addEventListener( composer.MultiTouch.MULTITOUCH_EVENT, composer.WingJigsawDrag )

    composer.MultiTouch.activate( layer.BeakJigsaw, “move”, “single” )
    local BeakJigsaw_lock = 0
    local BeakJigsaw_posX = 0; local BeakJigsaw_posY = 0;
    composer.BeakJigsawDrag = function (event )
    local t = event.target
    if event.phase == “began” then
    local parent = t.parent; parent:insert(t); display.getCurrentStage():setFocus(t); t.isFocus = true
    elseif event.phase == “moved” then
    BeakJigsaw_posX = layer.BeakJigsaw.x – layer.BeakShape.x
    BeakJigsaw_posY = layer.BeakJigsaw.y – layer.BeakShape.y
    if (BeakJigsaw_posX < 0) then
    BeakJigsaw_posX = BeakJigsaw_posX * -1
    end
    if (BeakJigsaw_posY < 0) then
    BeakJigsaw_posY = BeakJigsaw_posY * -1
    end
    if (BeakJigsaw_posX <= 20) and (BeakJigsaw_posY <= 20) then –in position
    layer.BeakJigsaw.x = layer.BeakShape.x
    layer.BeakJigsaw.y = layer.BeakShape.y
    BeakJigsaw_lock = 1
    else
    BeakJigsaw_lock = 0
    end
    elseif event.phase == “ended” or event.phase == “cancelled” then
    if (BeakJigsaw_lock == 1 and BeakJigsaw_posX <= 20) and (BeakJigsaw_posY <= 20) then
    layer.BeakJigsaw.x = layer.BeakShape.x
    layer.BeakJigsaw.y = layer.BeakShape.y
    composer.MultiTouch.deactivate(layer.BeakJigsaw)
    else
    layer.BeakJigsaw.x = layer.BeakJigsaw.oriX
    layer.BeakJigsaw.y = layer.BeakJigsaw.oriY
    end
    display.getCurrentStage():setFocus(nil); t.isFocus = false
    end
    return true
    end
    layer.BeakJigsaw:addEventListener( composer.MultiTouch.MULTITOUCH_EVENT, composer.BeakJigsawDrag )

    composer.MultiTouch.activate( layer.LegRJigsaw, “move”, “single” )
    local LegRJigsaw_lock = 0
    local LegRJigsaw_posX = 0; local LegRJigsaw_posY = 0;
    composer.LegRJigsawDrag = function (event )
    local t = event.target
    if event.phase == “began” then
    local parent = t.parent; parent:insert(t); display.getCurrentStage():setFocus(t); t.isFocus = true
    elseif event.phase == “moved” then
    LegRJigsaw_posX = layer.LegRJigsaw.x – layer.LegRShape.x
    LegRJigsaw_posY = layer.LegRJigsaw.y – layer.LegRShape.y
    if (LegRJigsaw_posX < 0) then
    LegRJigsaw_posX = LegRJigsaw_posX * -1
    end
    if (LegRJigsaw_posY < 0) then
    LegRJigsaw_posY = LegRJigsaw_posY * -1
    end
    if (LegRJigsaw_posX <= 50) and (LegRJigsaw_posY <= 50) then –in position
    layer.LegRJigsaw.x = layer.LegRShape.x
    layer.LegRJigsaw.y = layer.LegRShape.y
    LegRJigsaw_lock = 1
    else
    LegRJigsaw_lock = 0
    end
    elseif event.phase == “ended” or event.phase == “cancelled” then
    if (LegRJigsaw_lock == 1 and LegRJigsaw_posX <= 50) and (LegRJigsaw_posY <= 50) then
    layer.LegRJigsaw.x = layer.LegRShape.x
    layer.LegRJigsaw.y = layer.LegRShape.y
    composer.MultiTouch.deactivate(layer.LegRJigsaw)
    else
    layer.LegRJigsaw.x = layer.LegRJigsaw.oriX
    layer.LegRJigsaw.y = layer.LegRJigsaw.oriY
    end
    display.getCurrentStage():setFocus(nil); t.isFocus = false
    end
    return true
    end
    layer.LegRJigsaw:addEventListener( composer.MultiTouch.MULTITOUCH_EVENT, composer.LegRJigsawDrag )

    composer.MultiTouch.activate( layer.LegLJigsaw, “move”, “single” )
    local LegLJigsaw_lock = 0
    local LegLJigsaw_posX = 0; local LegLJigsaw_posY = 0;
    composer.LegLJigsawDrag = function (event )
    local t = event.target
    if event.phase == “began” then
    local parent = t.parent; parent:insert(t); display.getCurrentStage():setFocus(t); t.isFocus = true
    elseif event.phase == “moved” then
    LegLJigsaw_posX = layer.LegLJigsaw.x – layer.LegLShape.x
    LegLJigsaw_posY = layer.LegLJigsaw.y – layer.LegLShape.y
    if (LegLJigsaw_posX < 0) then
    LegLJigsaw_posX = LegLJigsaw_posX * -1
    end
    if (LegLJigsaw_posY < 0) then
    LegLJigsaw_posY = LegLJigsaw_posY * -1
    end
    if (LegLJigsaw_posX <= 50) and (LegLJigsaw_posY <= 50) then –in position
    layer.LegLJigsaw.x = layer.LegLShape.x
    layer.LegLJigsaw.y = layer.LegLShape.y
    LegLJigsaw_lock = 1
    else
    LegLJigsaw_lock = 0
    end
    elseif event.phase == “ended” or event.phase == “cancelled” then
    if (LegLJigsaw_lock == 1 and LegLJigsaw_posX <= 50) and (LegLJigsaw_posY <= 50) then
    layer.LegLJigsaw.x = layer.LegLShape.x
    layer.LegLJigsaw.y = layer.LegLShape.y
    composer.MultiTouch.deactivate(layer.LegLJigsaw)
    else
    layer.LegLJigsaw.x = layer.LegLJigsaw.oriX
    layer.LegLJigsaw.y = layer.LegLJigsaw.oriY
    end
    display.getCurrentStage():setFocus(nil); t.isFocus = false
    end
    return true
    end
    layer.LegLJigsaw:addEventListener( composer.MultiTouch.MULTITOUCH_EVENT, composer.LegLJigsawDrag )

    composer.MultiTouch.activate( layer.BodyJigsaw, “move”, “single” )
    local BodyJigsaw_lock = 0
    local BodyJigsaw_posX = 0; local BodyJigsaw_posY = 0;
    composer.BodyJigsawDrag = function (event )
    local t = event.target
    if event.phase == “began” then
    local parent = t.parent; parent:insert(t); display.getCurrentStage():setFocus(t); t.isFocus = true
    elseif event.phase == “moved” then
    BodyJigsaw_posX = layer.BodyJigsaw.x – layer.BodyShape.x
    BodyJigsaw_posY = layer.BodyJigsaw.y – layer.BodyShape.y
    if (BodyJigsaw_posX < 0) then
    BodyJigsaw_posX = BodyJigsaw_posX * -1
    end
    if (BodyJigsaw_posY < 0) then
    BodyJigsaw_posY = BodyJigsaw_posY * -1
    end
    if (BodyJigsaw_posX <= 50) and (BodyJigsaw_posY <= 50) then –in position
    layer.BodyJigsaw.x = layer.BodyShape.x
    layer.BodyJigsaw.y = layer.BodyShape.y
    BodyJigsaw_lock = 1
    else
    BodyJigsaw_lock = 0
    end
    act_scalebody()
    elseif event.phase == “ended” or event.phase == “cancelled” then
    if (BodyJigsaw_lock == 1 and BodyJigsaw_posX <= 50) and (BodyJigsaw_posY <= 50) then
    layer.BodyJigsaw.x = layer.BodyShape.x
    layer.BodyJigsaw.y = layer.BodyShape.y
    composer.MultiTouch.deactivate(layer.BodyJigsaw)
    end
    act_dropbody()
    display.getCurrentStage():setFocus(nil); t.isFocus = false
    end
    return true
    end
    layer.BodyJigsaw:addEventListener( composer.MultiTouch.MULTITOUCH_EVENT, composer.BodyJigsawDrag )

    — do not swipe this page

    — (BOTTOM) External code will render here
    end –ends phase did

    end — ends scene:show

    function scene:hide( event )
    — all disposal happens here
    if event.phase == “will” then

    composer.cancelAllTimers();
    if (nil ~= WingJigsaw ) then
    layer.WingJigsaw:removeEventListener ( composer.MultiTouch.MULTITOUCH_EVENT, composer.WingJigsawDrag );
    end
    –composer.Gesture.deactivate(layer.WingJigsaw)
    if (nil ~= BeakJigsaw ) then
    layer.BeakJigsaw:removeEventListener ( composer.MultiTouch.MULTITOUCH_EVENT, composer.BeakJigsawDrag );
    end
    –composer.Gesture.deactivate(layer.BeakJigsaw)
    if (nil ~= LegRJigsaw ) then
    layer.LegRJigsaw:removeEventListener ( composer.MultiTouch.MULTITOUCH_EVENT, composer.LegRJigsawDrag );
    end
    –composer.Gesture.deactivate(layer.LegRJigsaw)
    if (nil ~= LegLJigsaw ) then
    layer.LegLJigsaw:removeEventListener ( composer.MultiTouch.MULTITOUCH_EVENT, composer.LegLJigsawDrag );
    end
    –composer.Gesture.deactivate(layer.LegLJigsaw)
    if (nil ~= BodyJigsaw ) then
    layer.BodyJigsaw:removeEventListener ( composer.MultiTouch.MULTITOUCH_EVENT, composer.BodyJigsawDrag );
    end
    –composer.Gesture.deactivate(layer.BodyJigsaw)
    elseif event.phase == “did” then
    composer.test = nil
    end
    end

    function scene:destroy( event )
    — Remove all unecessary composer items
    composer.WingJigsawDrag = nil
    composer.BeakJigsawDrag = nil
    composer.LegRJigsawDrag = nil
    composer.LegLJigsawDrag = nil
    composer.BodyJigsawDrag = nil
    end

    scene:addEventListener( “create”, scene )
    scene:addEventListener( “show”, scene )
    scene:addEventListener( “hide”, scene )
    scene:addEventListener( “destroy”, scene )
    return scene

    Yamamoto
    Keymaster
    #83779

    I tested drag and scale with edit image and could not reproduce the problem.

    In your code above, act_drawing, act_scalebody and act_dropbody have the scale parameters with (xScale, yScale) = (-1, -1). This is a problem. I am not sure why it with set with -1. Would you send me .kwk project file to support@kwiksher.com ?

    >The drag works fine on these layers if I don’t use the scaling action,
    >but as soon as I add the scaling actions the image is flipped – on some layers, but not others.

    Does your scale action with edit image work fine if the action is triggered by a button?

    Fionnuala
    Participant
    #83784

    Hi Yamamoto

    Thanks a million, I have just sent the file.

    Fionnuala

    Yamamoto
    Keymaster
    #83788

    In .kwk, edit image is set with (-100, -100). So I modified each edit image parameters from kwik panel and set them to (100, 100).

    Do you know why it is set with -100? I would like to clarify whether kwik panel is a problem or publishing lua is an issue.

    Fionnuala
    Participant
    #83790

    Hi Yamamoto

    Thanks so much – that’s it!

    My apologies, it’s my mistake! If I increase the “edit image” in the first action (for the drag) by 110% and then set “edit image” back to 100% for the second action (“locked”) then it brings the layer back to it’s original size! (I thought I had to set “edit image” to -10% to get it back to the original size, which was causing the problem)

    Thanks for your help with clearing this up.

    Fionnuala

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Privacy Preference Center

Strictly Necessary

these coolies are for WP-SpamShield, gdpr-wp, woocommerce, paypal

PHPSESSID, SJECT16, JCS_INENREF, JCS_INENTIM, gdpr, woocommerce_cart_hash, woocommerce_items_in_cart, woocommerce_recently_viewed, wordpress_, wordpress_logged_in_, wordpress_sec_, wordpress_test_cookie, wp_woocommerce_session_, AKDC, akavpau_ppsd

Functionality

WordPress cookie created when auto-saving a post in the editor.

wp-saving-post, wp-settings-, wp-settings-time-

Performance

google analytic

__utma,__utmb,__utmc,__utmz,_ga,_gid,_gat

Advertising