Display Group不会旋转 - Corona SDK

我想让一个group围绕其中心点旋转一次,但是没有效果。请帮帮我,我错在哪里了?谢谢

local colorPalette = display.newGroup()

colorPalette, greenColor, darkGreenColor, darkBrownColor, brownColor =  artassets.getColorPalette()    --- 显示对象

    paletteGroup:insert(colorPalette)  ---插入它们到group中
    paletteGroup:insert(greenColor)
    paletteGroup:insert(darkGreenColor)
    paletteGroup:insert(darkBrownColor)
    paletteGroup:insert(brownColor)

    paletteGroup.anchorChildren = true
    paletteGroup.anchorX = 0.5
    paletteGroup.anchorY = 0.5
    paletteGroup:rotate( 90 )
点赞
用户3041972
用户3041972

有可能是你的对象定义有问题。以下是一个非常直观的例子:

    jobText = display.newText( "test", 50, 50, systemFontBold, 50 )
    jobText:setFillColor( 1,1,0 )

local function object( event )

    if event.phase == "began" then
        print( a/0 )

    end
    return true
end
local image = display.newImageRect( "bg.jpg", 100, 100 )
image.x = display.contentCenterX
image.y = display.contentCenterY
image.alpha = 0.5

jobText:addEventListener( "touch", object )

local paletteGroup = display.newGroup()
jobText:rotate(45)

    paletteGroup:insert(image)
    paletteGroup:insert(jobText)

    paletteGroup.anchorChildren = true
    paletteGroup.anchorX = .1
    paletteGroup.anchorY = .1
    paletteGroup:rotate( 20 )
2016-04-14 01:18:02