Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Categorize objects
Started by ok-sg Apr 23 2019 09:09 AM

2 replies to this topic

Best Answer nick_sherman , 23 April 2019 - 09:21 AM

Put them in a table, then apply stroke width in a loop on that table

 

 
local boxes = { box1, box2, box3, box4}
 
for key, value in pairs (boxes) do
 
 value.strokeWidth = 2
 
end
 

 

[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ok-sg

[GLOBAL: userInfoPane.html]
ok-sg
  • Observer

  • 9 posts
  • Corona SDK

Hello!

I have physics rectangles:

1 box

2 box

3 box

4 box

 

How to categorize these objects and apply global .strokeWidth to all rectangles?

 



[TOPIC: post.html]
#2

nick_sherman

[GLOBAL: userInfoPane.html]
nick_sherman
  • Corona Geek

  • 1,757 posts
  • Corona SDK

  Best Answer

Put them in a table, then apply stroke width in a loop on that table

 

 
local boxes = { box1, box2, box3, box4}
 
for key, value in pairs (boxes) do
 
 value.strokeWidth = 2
 
end
 

 


  • ok-sg likes this

[TOPIC: post.html]
#3

ok-sg

[GLOBAL: userInfoPane.html]
ok-sg
  • Observer

  • 9 posts
  • Corona SDK

Thank you, Nick!




[topic_controls]
[/topic_controls]