Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

nested display groups
Started by Miro Nov 07 2009 01:59 AM

- - - - -
1 reply to this topic
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Enthusiast

  • 76 posts
  • Guests

In the code below I am trying to place multiple instances of the display group 'tile' into another group and then access the properties (x and y etc..) of each tile object. I'm pretty new to this and I'm not sure if what I'm trying to do is possible or if I just have the syntax ( board[2].x = 100 ) wrong?

Can anybody help with this? thanks

local colourFiles = { red = "red.png", blue = "blue.png", yellow = "yellow.png" }

local tile =display.newGroup()
local board = display.newGroup()
for key, file in pairs( colourFiles ) do
	local colour = display.newImage( file )
	tile:insert( colour )
	tile[key] = colour

for i=1,3 do
	board:insert(i, tile )

board[2].x = 100
board[2].yellow.isVisible = false

PS I dont think the code tag is working properly
uid: 3018 topic_id: 225 reply_id: 300225

[TOPIC: post.html]

carlos m. icaza

[GLOBAL: userInfoPane.html]
carlos m. icaza
  • Corona Geek

  • 2,992 posts
  • Alumni

hmmm.... looking into it right now...

uid: 24 topic_id: 225 reply_id: 290