0

I get error message when i try to insert a table into a group

My table code is containing images

Here is the code i am using for the table

local myJoints = {}

for i = 1,5 do
    local link = {}
    for j = 1,17 do
        link[j] = display.newImage( "link.png" )
        link[j].x = 121 + (i*34)
        link[j].y = 55 + (j*17)
        physics.addBody( link[j], { density=2.0, friction=0, bounce=0 } )

        -- Create joints between links
        if (j > 1) then
            prevLink = link[j-1] -- each link is joined with the one above it
        else
            prevLink = wall -- top link is joined to overhanging beam
        end
            myJoints[#myJoints + 1] = physics.newJoint( "pivot", prevLink, link[j], 121 + (i*34), 46 + (j*17) )
    end
end

and here is the code for group

    GUI:insert(myJoints);

i have my background image in the GUI group and it is covering the table.

I don't know if it is actually possible to insert table into a group

Any help please

Thanks in Advance!

4

1 回答 1

0

您不能使用“插入”方法将表插入组,因为该方法正在寻找显示对象。尝试调用GUI.myJoints = myJoints. 还要记住,您的表格只是引用您的显示对象,这与将它们放在一个组中不同。

于 2013-05-11T23:34:01.623 回答