Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
Tutorial showing a list of general functions. tutorial, custom code, public functions, general

Public Functions:Asset.isAspect Functions

This is an alternate way of asking whether one asset is in or on or under or behind another aspect. These are functionally equivalent to using asset.$is(). You're welcome to use whichever version you prefer. Note that these methods only work for assets in the Tangible class tree, and will return false for non-tangible asset classes.

  • MyGame.$("asset").isAttached("asset name") {String} asset a name or id representing an asset Boolean This is a shortcut method to ask whether one asset is specifically in the attached aspect of another aspect, ignoring nested assets. This is functionally identical to using MyGame.$("asset").$is("attached", "other asset").
  • MyGame.$("asset").isBehind("asset name") {String} asset a name or id representing an asset Boolean This is a shortcut method to ask whether one asset is specifically in the behind aspect of another aspect, ignoring nested assets. This is functionally identical to using MyGame.$("asset").$is("behind", "other asset").
  • MyGame.$("asset").isIn("asset name") {String} asset a name or id representing an asset Boolean This is a shortcut method to ask whether one asset is specifically in the in aspect of another aspect, ignoring nested assets. This is functionally identical to using MyGame.$("asset").$is("in", "other asset").
  • MyGame.$("asset").isOn("asset name") {String} asset a name or id representing an asset Boolean This is a shortcut method to ask whether one asset is specifically in the on aspect of another aspect, ignoring nested assets. This is functionally identical to using MyGame.$("asset").$is("on", "other asset").
  • MyGame.$("asset").isUnder("asset name") {String} asset a name or id representing an asset Boolean This is a shortcut method to ask whether one asset is specifically in the under aspect of another aspect, ignoring nested assets. This is functionally identical to using MyGame.$("asset").$is("under", "other asset").

  • MyGame.$("asset").isWithin("asset name") {String} asset a name or id representing an asset Boolean This is a shortcut method to ask whether one asset is contained anywhere inside of another, inclusive of all of the parent asset's aspects. Which is to say, this will return true if the child asset is in or under or behind or on (or any other preposition) the parent asset, even if it's nested within other assets.

  • MyGame.$("asset").has("asset name") {String} asset a name or id representing an asset Boolean This is the reverse way of asking asset.isWithin("other asset"), a shortcut method to ask whether one asset has another asset inside of it, inclusive of all of the parent asset's aspects. Which is to say, this will return true if the child asset is in or under or behind or on (or any other preposition) the parent asset. Whether you use assetA.isWithin(assetB) or assetB.has(assetA) is purely a matter of preference.

  • MyGame.$("asset").doesContain("asset") {String} asset a name or id representing an asset Boolean This is a shortcut method to ask whether one asset contains a substance, ie: does the bucket contain water? (Though it will also return true for tangibles, ie: does the bucket contain the shovel?) While it's similar to isWithin(), it only does a shallow search that doesn't consider nested items.