Hiding Objects

Hi,

I noticed some controls such as the widget does not have a Visible property. If I wanted to hide it what is the best method? Can I just set the position of the button off the screen until I need it?

Thanks,

Warren
[import]uid: 184193 topic_id: 33355 reply_id: 333355[/import]

Yes you can. [import]uid: 52491 topic_id: 33355 reply_id: 132468[/import]

You can also insert the widgets into their own display group and set the group to be invisible

-- create the groups  
mainGroup = display.newGroup()  
subGroup = display,newGroup()  
  
-- insert the group to make invisible into the parent group  
mainGroup:insert( subGroup )  
subGroup:insert( myWidget )  
  
-- set the group to be invisible  
subGroup.isVisible = false  
subGroup.isHitTestable = false  

In the above code everything in the main group remains visible. I used this to create one overarching .lua that handles all of my game menus, I just set the previous view to be invisible and either create or set the new view to visible. [import]uid: 181948 topic_id: 33355 reply_id: 132499[/import]

Yes you can. [import]uid: 52491 topic_id: 33355 reply_id: 132468[/import]

You can also insert the widgets into their own display group and set the group to be invisible

-- create the groups  
mainGroup = display.newGroup()  
subGroup = display,newGroup()  
  
-- insert the group to make invisible into the parent group  
mainGroup:insert( subGroup )  
subGroup:insert( myWidget )  
  
-- set the group to be invisible  
subGroup.isVisible = false  
subGroup.isHitTestable = false  

In the above code everything in the main group remains visible. I used this to create one overarching .lua that handles all of my game menus, I just set the previous view to be invisible and either create or set the new view to visible. [import]uid: 181948 topic_id: 33355 reply_id: 132499[/import]