Interface IEnabledComponent
Adds the ability for an entity to be disabled/enabled. Only enabled entities can be interacted with by the player.
Inherited Members
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
[RequiredComponent(typeof(IInObjectTreeComponent), true)]
public interface IEnabledComponent : IComponent, IDisposable, INotifyPropertyChanged
Properties
| Improve this Doc View SourceClickThrough
Gets or sets a value indicating whether this entity is click-through, meaning it can't be clicked. The difference between setting an entity to be click-through and between disabling it (by setting its Enabled property to be false), is that unlike disabling, the children of the entity will not be affected.
Declaration
bool ClickThrough { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Enabled
Gets or sets a value indicating whether this entity is enabled. Note that even if you set the entity to be enabled, it might still appear as disabled if it's part of a tree and its parent (or the parent's parent, or the parent's grandparent, and so on) is itself disabled. However the setting will be remembered (via the UnderlyingEnabled property) so if the parent will become enabled the entity will also become enabled if was set to be enabled before.
Declaration
bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Examples
button.TreeNode.SetParent(null); // the button has no parent
button.Enabled = true;
Debug.WriteLine("Is button enabled? {0}, button.Enabled); //This will print "Is button enabled? True".
button.TreeNode.SetParent(panel); // the panel is now the parent of the button.
panel.Enabled = false;
Debug.WriteLine("Is button enabled? {0}, button.Enabled); //This will print "Is button enabled? False" because the parent is disabled.
panel.Enabled = true;
Debug.WriteLine("Is button enabled? {0}, button.Enabled); //This will print "Is button enabled? True" because both the parent and the button are enabled.
|
Improve this Doc
View Source
UnderlyingEnabled
Gets a value indicating whether this entity underlying property is enabled. If the entity was set to be enabled but its parent is disabled, the entity will read as disabled. The "UnderlyingEnabled" property however, will remember that the entity was set to be enabled, so in case the parent will be enabled, the entity will remember that it is now enabled as well.
Declaration
bool UnderlyingEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|