Libraries.Interface.Controls.Scenes.Assets.AssetPack Documentation

The AssetPack class defines a set of blueprints organized into categories to be used by a ScenePalette. The scene palette loads asset packs to create the tree with all available items the user has to add to a scene. AssetPack supports both 2D and 3D items which can either be added manually using blueprints or through a JSON file that describes a whole tileset.

Inherits from: Libraries.Language.Object

Variables Table

VariablesDescription
text DEFAULT

Actions Documentation

Add(Libraries.Game.Graphics.Drawable drawable)

This action adds a drawable to the default category. This Add does not need a blueprint because one will be generated for it.

Parameters

Add(Libraries.Interface.Controls.Scenes.Blueprints.ItemBlueprint item)

This action adds a blueprint to the default category.

Parameters

Add(Libraries.Game.Graphics.ImageSheet sheet)

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

GetBlueprint(text name)

GetBlueprint returns the ItemBlueprint associated with a particular name.

Parameters

  • text name: The name of the blueprint to look for

Return

Libraries.Interface.Controls.Scenes.Blueprints.ItemBlueprint: The blueprint associated with that name

GetBlueprintIterator()

GetBlueprintIterator returns an Iterator for all blueprints objects that have been added to this asset pack.

Return

Libraries.Containers.Iterator:

GetCategory(text category)

GetCategory returns an Array for all the ItemBlueprints grouped in a specified category.

Parameters

  • text category: The name of the category whose blueprints should be returned

Return

Libraries.Containers.Array:

GetCategoryKeyIterator()

GetCategoryKey returns an Iterator for all categories in this asset pack.

Return

Libraries.Containers.Iterator:

GetDefaultCategory()

GetDefaultCategory returns an Iterator for all the ItemBlueprints grouped in the Default category. If a blueprint is added with specifying a category they will be added to the default category.

Return

Libraries.Containers.Iterator:

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetKeyIterator()

GetKeyIterator returns an Iterator for all the names of blueprints that have been added to the asset pack.

Return

Libraries.Containers.Iterator:

GetName()

Returns the name of the asset pack. The name affects the name that will appear on a ScenePalette.

Return

text:

GetTileset3DFolder()

Returns the path to the folder containing all the models and icons for a 3D tileset.

Return

Libraries.System.File:

LoadTileset(Libraries.System.File file)

LoadTileset loads a 2D tileset from a JSON file. The JSON should contain the name of the item, width, height, and the file path to the texture. This action will create blueprints for each entry in the tileset. If the JSON has a category field the items will be added to a category with the same name as the text in that field.

Parameters

LoadTileset3D(Libraries.System.File file)

LoadTileset3D loads a 3D tileset from a JSON file. The JSON should contain the name of the item, and the file path to the model, and path to its icon. This action will create blueprints for each entry in the tileset. If the JSON has a category field the items will be added to a category with the same name as the text in that field.

Parameters

SetName(text name)

Sets the name of the asset pack. The name affects the name that will appear on a ScenePalette.

Parameters

  • text name

SetTileset3DFolder(Libraries.System.File tileset3DFolder)

Sets the path for the folder that contains all the models and icons for the 3D tileset. Calling LoadTileset3D only expects the path to the JSON with all the information for each model but paths for models and icons will be relative to this folder.

Parameters