ChevronTexture

Package: Libraries.Interface.Views · Inherits from: Libraries.Language.Object

The ChevronTexture class makes a white chevron, ">", as a square texture of a given size in pixels, for arrows such as a tree item's. Each pixel's alpha is the share of 16 sample points in it that the chevron's stroke covers, so its edges are smooth when it is drawn at that size. Turn it to point another way, and tint it with a color. Each size is made once and shared, so many arrows of one size use one texture.

Example Code

use Libraries.Interface.Views.ChevronTexture
use Libraries.Game.Graphics.Drawable

ChevronTexture chevrons
Drawable arrow
arrow:Load(chevrons:GetTexture(16))
// Pointing down.
arrow:SetRotation(90)

Actions

GetTexture(integer size)

Returns the chevron for a size, making it the first time: a white ">" whose pixels' alpha is the share of their sample points inside its stroke.

Parameters

  • size integer: The texture's width and height, in pixels.

Returns

Libraries.Game.Graphics.Texture: The texture.

Inherited Actions

3 actions from Libraries.Language.Object