Libraries.Interface.Controls.Scenes.Blueprints.DrawableBlueprint Documentation
The DrawableBlueprint class is used in the 2D scene editor to add Drawable type items to scenes such as squares, circles, and other simple 2D shapes. This class builds on top of the ItemBlueprint class and adds fields relating to the Texture of the Drawable and the drawable is used as icon for use in palettes. There are also fields for the preferred Grid dimensions to make it easier for use in the editor with grid snapping enabled.
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
- Libraries.Language.Object: The object to compare to.
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
- Libraries.Language.Object: The to be compared.
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)
GetColor()
This action returns the color of the drawable. This isn't what the color of the loaded texture is but what color is used to modify the texture.
Return
Libraries.Game.Graphics.ColorGroup: color The color to use for this texture.
GetDescription()
This action returns the text description of the blueprint.
Return
text: The description of this blueprint
GetDrawableType()
Drawable type refers to the type of shape the drawable is. This action returns the type set for this blueprint A value of 0 means it is a custom type and negative values usually mean invalid or not loaded. Here are other accepted values for drawables taken from the SceneProperties class: RECTANGLE = 1, FILLED_RECTANGLE = 2, CIRCLE = 3, FILLED_CIRCLE = 4, FILLED_TRIANGLE = 5, CUSTOM_SHAPE = 6
Return
integer: The type of drawable
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()
GetHeight()
Returns the height of the texture
Return
number: The height of the texture
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 returns the texture to use for an icon in a palette.
Return
Libraries.Game.Graphics.TextureRegion: The palette icon texture
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
GetPreferredGridHeight()
This action returns a grid height that will nicely fit the texture
Return
integer: A height that a grid can be that will nicely fit the texture
GetPreferredGridWidth()
This action returns a grid width that will nicely fit the texture
Return
integer: a width that a grid can be that will nicely fit the texture
GetResponsiveness()
This action returns the responsiveness field of this blueprint.
Return
integer: The responsiveness field
GetRotation()
This action returns how much the texture is being rotated in degrees
Return
number: The current rotation of the texture in degrees
GetScaleX()
Returns the scale of the texture on the x-axis
Return
number: The amount of scaling on the x-axis
GetScaleY()
Returns the scale of the texture on the x-axis
Return
number: The amount of scaling on the x-axis
GetTexture()
This action returns the texture the blueprint is using.
Return
Libraries.Game.Graphics.TextureRegion: The texture the blueprint is using
GetWidth()
Returns the width of the texture
Return
number: The width of the texture
IsPhysicsEnabled()
This action returns the physics enabled field of this blueprint.
Return
boolean: The physics enabled field
SetColor(Libraries.Game.Graphics.ColorGroup color)
Color is a modifiable option in the editor so the color for the drawable can be set here.
Parameters
- Libraries.Game.Graphics.ColorGroup: The color to use for this texture
SetDescription(text description)
This action sets the text description of the blueprint.
Parameters
- text description: The new description of this blueprint
SetDrawableType(integer type)
Drawable type refers to the type of shape the drawable is. The editor will mainly check that this value is not negative because negative values are invalid. 0 is an accepted value which means custom. Here are other accepted values for drawables taken from the SceneProperties class: RECTANGLE = 1, FILLED_RECTANGLE = 2, CIRCLE = 3, FILLED_CIRCLE = 4, FILLED_TRIANGLE = 5, CUSTOM_SHAPE = 6
Parameters
- integer type: The type of drawable
SetHeight(number height)
Sets the height of the texture
Parameters
- number height: The height of the texture
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
SetPreferredGridHeight(integer preferredGridHeight)
This action sets a value for a grid height that is preferable for the texture. What preferable means for the texture will vary but for example, the preferred height for a square shaped drawable might be the height of the square texture.
Parameters
- integer preferredGridHeight: The height that a grid can be that will nicely fit the texture
SetPreferredGridWidth(integer preferredGridWidth)
This action sets a value for a grid width that is preferable for the texture. What preferable means for the texture will vary but for example, the preferred width for a square shaped drawable might be the width of the square texture.
Parameters
- integer preferredGridWidth: The width that a grid can be that will nicely fit the texture
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
SetRotation(number rotation)
This action sets how much to rotate the texture by in degrees
Parameters
- number rotation: amount to rotate the texture by in degrees
SetScale(number scaleX, number scaleY)
Sets the scale of the texture on both axes
Parameters
- number scaleX: The amount of scaling on the x-axis
- number scaleY: The amount of scaling on the y-axis
SetScaleX(number scaleX)
Sets the scale of the texture on the x-axis
Parameters
- number scaleX: How much to scale the texture on the x-axis
SetScaleY(number scaleY)
Sets the scale of the texture on the y-axis
Parameters
- number scaleY: How much to scale the texture on the y-axis
SetSize(number width, number height)
Sets the width and height of the texture
Parameters
- number width: The width of the texture
- number height: The height of the texture
SetTexture(Libraries.Game.Graphics.TextureRegion texture)
This action sets the texture the blueprint will be using.
Parameters
- Libraries.Game.Graphics.TextureRegion: The texture the blueprint will load
SetWidth(number width)
Sets the width of the texture
Parameters
- number width: The width of the texture
On this page
Variables TableAction Documentation- Compare(Libraries.Language.Object object)
- Equals(Libraries.Language.Object object)
- GetColor()
- GetDescription()
- GetDrawableType()
- GetHashCode()
- GetHeight()
- GetName()
- GetPaletteCrop()
- GetPaletteIcon()
- GetPaletteScale()
- GetPreferredGridHeight()
- GetPreferredGridWidth()
- GetResponsiveness()
- GetRotation()
- GetScaleX()
- GetScaleY()
- GetTexture()
- GetWidth()
- IsPhysicsEnabled()
- SetColor(Libraries.Game.Graphics.ColorGroup color)
- SetDescription(text description)
- SetDrawableType(integer type)
- SetHeight(number height)
- SetName(text name)
- SetPaletteCrop(number paletteCrop)
- SetPaletteScale(number paletteScale)
- SetPhysicsEnabled(boolean enabled)
- SetPreferredGridHeight(integer preferredGridHeight)
- SetPreferredGridWidth(integer preferredGridWidth)
- SetResponsiveness(integer responsive)
- SetRotation(number rotation)
- SetScale(number scaleX, number scaleY)
- SetScaleX(number scaleX)
- SetScaleY(number scaleY)
- SetSize(number width, number height)
- SetTexture(Libraries.Game.Graphics.TextureRegion texture)
- SetWidth(number width)