Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

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

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

Miro

[GLOBAL: userInfoPane.html]
Miro
  • 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
end

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

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]
#2

carlos m. icaza

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

  • 2,992 posts
  • Alumni

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

carlos
uid: 24 topic_id: 225 reply_id: 290



[topic_controls]
[/topic_controls]