ExposedInDerived

Introduction

The ExposedInDerived property on an object allows an object to be accessible in a derived Entity. This is useful if a base Entity defines the source of an object (such as which Sprite in a .scnx to use), but the derived will modify its values (such as its CurrentChainName property).

Object Access

Providing proper access to your objects can be a little complex at first, but it is the key to “scalability” (the property of being able to continually grow the size of your game while minimizing complexity).

In short, there are three “levels” of access you can provide in Glue:

  • No access in derived elements (default)
  • ExposedInDerived set to true
  • SetByDerived set to true

If no access is given, then an Entity’s objects will be hidden from derived Entities. This allows derived entities to simply inherit a “closed” object. It is rare to have a base entity that does not provide access to any of its contained objects to a derived entity, but this option exists in case you want to limit access to some.

ExposedInDerived allows you to access and modify an existing Object in a derived Entity, but you do not have access to set it to something different. This is common for Entities which include lists that are to be populated by derived Entities. You can also do things like change properties on ExposedInDeived objects.

SetByDerived allows you to completely change an Object in an derived Entity. In other words, an Entity can specify that it uses a Sprite, but the derived Entity can specify which .scnx the Sprite comes from.