The texture alpha threshold used for point containment tests. If set to a value larger than 0, the texture alpha data is extracted from the texture at 25% resolution.
The indices of the geometry.
Protected
_textureThe texture alpha data.
Protected
_widthThe width of the sprite (this is initially set by the texture).
Protected
_heightThe height of the sprite (this is initially set by the texture)
Protected
_shaderThe shader bound to this mesh.
Protected
vertexThis is used to store the vertex data of the sprite (basically a quad).
Protected
uvsThis is used to store the uvs data of the sprite, assigned at the same time as the vertexData in calculateVertices().
Protected
_textureThe texture that the sprite is using.
Protected
_anchorThe anchor point defines the normalized coordinates in the texture that map to the position of this sprite.
By default, this is (0,0)
(or texture.defaultAnchor
if you have modified that), which means the position
(x,y)
of this Sprite
will be the top-left corner.
Note: Updating texture.defaultAnchor
after
constructing a Sprite
does not update its anchor.
https://docs.cocos2d-x.org/cocos2d-x/en/sprites/manipulation.html
Protected
_batchSnapshot of some parameters of this display object to render in batched mode.
Protected
_textureIDThe texture ID.
Protected
Internal
_cachedCached tint value so we can tell when the tint is changed.
Protected
_textureThe texture trimmed ID.
Protected
vertexThis is used to calculate the bounds of the object IF it is a trimmed sprite.
Protected
_tintThe tint applied to the sprite. This is a hex value. A value of 0xFFFFFF will remove any tint effect.
Protected
_tintRGBThe tint applied to the sprite. This is a RGB value. A value of 0xFFFFFF will remove any tint effect.
Protected
_textureAn instance of a texture uvs used for padded SpriteMesh. Instanced only when padding becomes non-zero.
Protected
_tintUsed to track a tint or alpha change to execute a recomputation of _cachedTint.
Protected
_paddingXProtected
_paddingYPrivate
#geometryGeometry bound to this SpriteMesh.
Private
#stateThe PIXI.State of this SpriteMesh.
Static
Private
#TEMP_A temporary point used by this class.
The blend mode applied to the SpriteMesh.
PIXI.BLEND_MODES.NORMAL
The texture that the sprite is using.
The shader bound to this mesh.
The x padding in pixels (must be a non-negative value.)
They y padding in pixels (must be a non-negative value.)
The maximum x/y padding in pixels (must be a non-negative value.)
If true PixiJS will Math.round() x/y values when rendering, stopping pixel interpolation. Advantages can include sharper image quality (like text) and faster rendering on canvas. The main disadvantage is movement of objects may appear less smooth. To set the global default, change PIXI.settings.ROUND_PIXELS
PIXI.settings.ROUND_PIXELS
Used to force an alpha mode on this sprite mesh. If this property is non null, this value will replace the texture alphaMode when computing color channels. Affects how tint, worldAlpha and alpha are computed each others.
Returns the SpriteMesh associated batch plugin. By default the returned plugin is that of the associated shader. If a plugin is forced, it will returns the forced plugin.
The anchor sets the origin point of the sprite. The default value is taken from the PIXI.Texture|Texture and passed to the constructor.
The default is (0,0)
, this means the sprite's origin is the top left.
Setting the anchor to (0.5,0.5)
means the sprite's origin is centered.
Setting the anchor to (1,1)
would mean the sprite's origin point will be the bottom right corner.
If you pass only single parameter, it will set both x and y to the same value as shown in the example below.
The tint applied to the sprite. This is a hex value.
A value of 0xFFFFFF will remove any tint effect.
0xFFFFFF
The HTML source element for this SpriteMesh texture.
Is this SpriteMesh rendering a video texture?
An all-in-one helper method: Resizing the PCO according to desired dimensions and options. This helper computes the width and height based on the following factors:
Additionally, It takes into account the desired fit options:
You can also apply optional scaleX and scaleY options to both width and height. The scale is applied after fitting.
Important: By using this helper, you don't need to set the height, width, and scale properties of the DisplayObject.
Note: This is a helper method. Alternatively, you could assign properties as you would with a PIXI DisplayObject.
The base width used for computations.
The base height used for computations.
Optional
options: { The options.
The fit type.
The scale on X axis.
The scale on Y axis.
Protected
_onPrivate
#containsPrivate
#getPrivate
#renderPrivate
#renderPrivate
#renderRender without batching.
The renderer
The shader
Static
fromCreate a SpriteMesh from another source. You can specify texture options and a specific shader class derived from BaseSamplerShader.
Source to create texture from.
Optional
textureOptions: objectSee PIXI.BaseTexture's constructor for options.
Optional
shaderClass: BaseSamplerShaderThe shader class to use. BaseSamplerShader by default.
A basic PCO sprite mesh which is handling occlusion and depth.
Mixes
PrimaryOccludableObjectMixin
Mixes
PrimaryCanvasObjectMixin
Param: options
The constructor options.
Param: options.texture
Texture passed to the SpriteMesh.
Param: options.shaderClass
The shader class used to render this sprite.
Param: options.name
The name of this sprite.
Param: options.object
Any object that owns this sprite.