Libraries.Interface.Controls.Scenes.Blueprints.CustomItemBlueprint Documentation

An ItemBlueprint that takes an input file to load a custom asset. This class isn't meant to be used directly since what file is valid for an asset depends on the type of item. For example, a custom 2D asset might not know what to do with a text file to make a new asset.

Inherits from: Libraries.Interface.Controls.Scenes.Blueprints.ItemBlueprint, Libraries.Language.Object

Actions Documentation

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)

GetDescription()

This action returns the text description of the blueprint.

Return

text: The description of this blueprint

GetFile()

This action returns the file object pointing to the custom asset.

Return

Libraries.System.File: The file for the custom asset

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()

GetName()

This action returns the name of the blueprint.

Return

text: The name of this blueprint

GetPaletteCrop()

This action returns how much to crop the palette image so it can be fitted into an icon properly.

Return

number: A number representing how much to crop the icon

GetPaletteIcon()

This action would return the texture for an icon of this blueprint. The icon can be used in a palette so the user can see what item looks like before being added to the scene.

Return

Libraries.Game.Graphics.TextureRegion: The texture for an icon

GetPaletteScale()

This action returns the scale of the icon so the icon can be sized properly when in a palette.

Return

number: The scale to be used in a palette

GetResponsiveness()

This action returns the responsiveness field of this blueprint.

Return

integer: The responsiveness field

IsFileValid(Libraries.System.File file)

Returns true if the given file is of a valid file type for this blueprint, or false otherwise.

Parameters

Return

boolean:

IsPhysicsEnabled()

This action returns the physics enabled field of this blueprint.

Return

boolean: The physics enabled field

SetDescription(text description)

This action sets the text description of the blueprint.

Parameters

  • text description: The new description of this blueprint

SetFile(Libraries.System.File file)

This action sets the file object pointing to the custom asset.

Parameters

SetName(text name)

This action sets the name of the blueprint.

Parameters

  • text name: The new name of this blueprint

SetPaletteCrop(number paletteCrop)

This action sets how much to crop the palette image so it can be fitted into an icon properly.

Parameters

  • number paletteCrop: The amount to crop the palette icon

SetPaletteScale(number paletteScale)

This action sets the scale of the icon so the icon can be sized properly when in a palette.

Parameters

  • number paletteScale: The scale to be used in a palette

SetPhysicsEnabled(boolean enabled)

This action sets the physics enabled field of this blueprint.

Parameters

  • boolean enabled: If true this blueprint has physics enabled by default for this item

SetResponsiveness(integer responsive)

This action sets the responsiveness field of this blueprint.

Parameters

  • integer responsive: An integer for how this item will respond to other physics objects