custom-asset
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
custom-asset [2022/03/29 20:53] – minotorious | custom-asset [2022/03/30 10:16] (current) – minotorious | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ASSET classes are the basic registerable types in Foundation. | + | [[assets|ASSET]] classes are the basic registerable types in Foundation. |
- | For reference all available ASSET classes can be found in [[api# | + | For reference all available |
===== Creating & Using a Custom ASSET Object ===== | ===== Creating & Using a Custom ASSET Object ===== | ||
Line 10: | Line 10: | ||
<code lua> | <code lua> | ||
local MY_ASSET_OBJECT = { | local MY_ASSET_OBJECT = { | ||
- | TypeName = " | + | TypeName = " |
DataType = " | DataType = " | ||
Properties = { | Properties = { | ||
Line 21: | Line 21: | ||
mod: | mod: | ||
</ | </ | ||
- | Note that ASSETs | + | Note that [[assets|ASSET]]s |
- | Also remember that you can define properties based on the basic [[data-types|data types]] (i.e. string, integer, float, etc.) or based on any of the existing DATA or ASSET objects, as well as '' | + | Also remember that you can define properties based on the basic [[data-types|data types]] (i.e. string, integer, float, etc.) or based on any of the existing |
==== Step 2: Registering an Instance of an ASSET Object ==== | ==== Step 2: Registering an Instance of an ASSET Object ==== | ||
Note: This also aplies to using vanilla ASSET objects! | Note: This also aplies to using vanilla ASSET objects! | ||
- | In your mod's lua code you when you want to register an instance of your new ASSET object you will have to use the '' | + | In your mod's lua code you when you want to register an instance of your new [[assets|ASSET]] object you will have to use the '' |
<code lua> | <code lua> | ||
mod: | mod: | ||
- | DataType = " | + | DataType = " |
Id = " | Id = " | ||
Property1 = " | Property1 = " | ||
Line 44: | Line 44: | ||
When you want to use your new ASSET instance be it in a [[api/ | When you want to use your new ASSET instance be it in a [[api/ | ||
- | For example here we are using our custom ASSET instance as the default value in a [[api/ | + | For example here we are using our custom |
<code lua> | <code lua> | ||
local COMP_EXAMPLE = { | local COMP_EXAMPLE = { |
custom-asset.1648601638.txt.gz · Last modified: 2022/03/29 20:53 by minotorious