Image Gone after Insert to Group

Before i insert image object into group, it’s showing on the screen
But after i insert them into group, it’s missing from screen and without any error message

any idea?

Thanks! [import]uid: 10373 topic_id: 4177 reply_id: 304177[/import]

Hi, can you share your code?

Tim [import]uid: 8196 topic_id: 4177 reply_id: 12973[/import]

Sorry Tim,

But the proj composed of sound, images, and diff lib files,
i can say it’s quite huge proj

But here’s my basic structure
global.lua

[code]

require(‘funext’)…

– screen top queue object group
topQueueObj = {img = display.newGroup(), txt = display.newGroup()}[/code]

main.lua

require('global')  
require('gmenu')  
  
code calling function in gmenu lib  

gmenu.lua

 code calling loadLevel function which logic in funext lib file

funext.lua

[code]
local qObj = display.newImage(gShapes[o.id].actualSizeImage)
qObj.x, qObj.y = startPosX, startPosY

qObj.id = o.id
qObj.scale_x = o.scale_x
qObj.scale_y = o.scale_y

local text = display.newText(round(qObj.width * o.scale_x, 0) … ‘x’ … round(qObj.height * o.scale_x, 0), qObj.x - (iconWidth / 2), qObj.y + 15)
text:setTextColor(255, 255, 255)
text.size = 10

TWO LINES BELOW MAKE MY OBJECTS NOT SHOWN ON SCREEN, IF I REMOVE IT, THEY ARE SHOWN ON SCREEN
– move text and images of top queue to group
topQueueObj.img:insert(qObj)
topQueueObj.txt:insert(text)

[/code] [import]uid: 10373 topic_id: 4177 reply_id: 12974[/import]

but topQueueObj exists in global.lua not funext.lua

try this in funext.lua

[lua]print(topQueueObj)[/lua]

you will get “nil” won’t you?

[import]uid: 6645 topic_id: 4177 reply_id: 12977[/import]

nope, here my code

 print('topQueueObj')  
 print(topQueueObj)  

here my log

topQueueObj
table: 0x6bdf90
topQueueObj
table: 0x6bdf90
topQueueObj
table: 0x6bdf90
topQueueObj
table: 0x6bdf90
topQueueObj
table: 0x6bdf90

[import]uid: 10373 topic_id: 4177 reply_id: 12982[/import]

ok sorry don’t know. why not upload a zip of the files? or at least those required to test the problem [import]uid: 6645 topic_id: 4177 reply_id: 12985[/import]

Sorry if this seems to be skirting the issue, but if images are disappearing when being added to a display group I would say that the display group being added to might have an alpha of 0, have isVisible = false or simply be behind something. It may also be an x|yReference or x|yOrigin value problem - meaning the the object gets shifted off-screen because of it’s internal reference places it too far away from the origin of the display group.

Just some thoughts, but of course without seeing the whole thing in process its hard to figure.

Matt.

Ps: When the likely produces no results, go with the unlikely. [import]uid: 8271 topic_id: 4177 reply_id: 13014[/import]