pixi.display.Sprite
- type
- class
- extends
- DisplayObjectContainer
- subclasses
- pixi.display.MovieClip, pixi.extras.TilingSprite, pixi.plugins.input.core.InputObject, pixi.text.Text
- metadata
- :native
- "PIXI.Sprite"
Static Methods
- parameters
frameId
{String} The frame Id of the texture in the cache
- returns
- {Sprite} A new Sprite using a texture from the texture cache matching the frameId
- parameters
imageId
{String}
[crossorigin]
{Bool}
[scaleMode]
{Int}
- returns
- {Sprite} A new Sprite using a texture from the texture cache matching the imageId
Constructor
- parameters
texture
{Texture} The texture for this sprite A sprite can be created directly from an image like this : var sprite = new PIXI.Sprite.fromImage('assets/image.png'); yourStage.addChild(sprite); then obviously don't forget to add it to the stage you have already created
- parameters
child
{DisplayObject} The DisplayObject to add to the container
- parameters
child
{DisplayObject} The child to add
index
{Int} The index to place the child in
- parameters
resolution
{Float} The resolution of the texture being generated
scaleMode
{Int} Should be one of the PIXI.scaleMode consts
[renderer]
{CanvasRenderer|WebGLRenderer} The renderer used to generate the texture.
- returns
- {Texture} a texture of the graphics object
- parameters
[matrix]
{Matrix}
- returns
- {Rectangle} the rectangular bounding area
- parameters
index
{Int} The index to get the child from
- returns
- {DisplayObject}
- parameters
name
{String} The name of the child
- returns
- {DisplayObject}
- metadata
- :keep
- parameters
child
{DisplayObject} The DisplayObject instance to identify
- returns
- {Int} The index position of the child display object to identify
- returns
- {Rectangle} the rectangular bounding area
- parameters
child
{DisplayObject} The DisplayObject to remove
- parameters
index
{Int} The index to get the child from
- parameters
beginIndex
{Int} The beginning position. Predefined value is 0.
[endIndex]
{Int} The ending position. Predefined value is children's array length.
- parameters
child
{DisplayObject} The child DisplayObject instance for which you want to change the index number
index
{Int} The resulting index number for the child display object
- parameters
stage
{Stage} the stage that the object will have as its current stage reference
- parameters
texture
{Texture} The PIXI texture that is displayed by the sprite
- parameters
child1
{DisplayObject}
child2
{DisplayObject}
- parameters
position
{Point} The world origin to calculate from
- returns
- {Point} A point object representing the position of this object
- parameters
position
{Point} The world origin to calculate from
[frm]
{DisplayObject} The DisplayObject to calculate the global position from
- returns
- {Point} A point object representing the position of this object