Components Enabled vs. Visible study

79 views
Skip to first unread message

Scott Ferguson

unread,
Jan 26, 2014, 5:57:32 PM1/26/14
to

YouTube video: http://youtu.be/SVsyJfSvai8



This cursory study answers some questions about what can be done with components when they are set Visible false or Enabled false.
An ImageSprite and Button were tested.

Setting Visible to false for an ImageSprite means it's events will not fire such as CollidedWith and Touched.
But, a moving (Speed not 0) and bouncing ImageSprite will continue to move and bounce.
To stop it from moving and bouncing set Enabled to false.

Setting Visible to false for a button affects the screen layout as components to the right or below may shift left or up, and it's events will not fire as it cannot be touched.

Another result was that even though the ImageSprite and Button were disabled but Visible, their Widths could be visibly adjusted.

In general I found that setting Enabled to false for a visible component means that events such as CollidedWith, Click, Touched, etc. are not active and Buttons dim.
I imagine other visible components other than the sprites dim as well.

Finally, regardless of the Visible or Enabled setting, properties can be set or read.

component     Visible    Enabled     r/w properties   events
ImageSprite    false                    yes            no      
                          false         yes            no      
Button         false                    yes            no
                          false         yes            no            


EanbledVsVisibleStudy.aia
Reply all
Reply to author
Forward
0 new messages