Packagealternativa.engine3d.materials
Classpublic class SpriteTextureMaterial
InheritanceSpriteTextureMaterial Inheritance SpriteMaterial Inheritance Material

The material draws a texture at a sprite's location. A texture is drawn as if it is on a plane that is parallel to the viewport plane and the top edge of the texture is parallel to the top edge of the viewport. The origin of a texture is placed at the projected sprite's point on a viewport. By default the origin of a texture is translated to the texture's center.



Public Properties
 PropertyDefined by
 Inheritedalpha : Number
material opacity
Material
 InheritedblendMode : String
Color blending mode.
Material
  originX : Number
Relative displacement of a texture's origin along its X axis.
SpriteTextureMaterial
  originY : Number
Relative displacement of a texture's origin along its Y axis.
SpriteTextureMaterial
  smooth : Boolean
Texture smoothing.
SpriteTextureMaterial
 Inheritedsprite : Sprite3D
The sprite which owns this material.
SpriteMaterial
  texture : Texture
A texture to draw.
SpriteTextureMaterial
Public Methods
 MethodDefined by
  
SpriteTextureMaterial(texture:Texture, alpha:Number = 1, smooth:Boolean = false, blendMode:String, originX:Number = 0.5, originY:Number = 0.5)
Creates an instance of the class.
SpriteTextureMaterial
  
Clones material.
SpriteTextureMaterial
Protected Methods
 MethodDefined by
 Inherited
markToChange():void
Marks a material as changed, sending a signal to the scene.
SpriteMaterial
Property detail
originXproperty
originX:Number  [read-write]

Relative displacement of a texture's origin along its X axis.

The default value is 0.5.

Implementation
    public function get originX():Number
    public function set originX(value:Number):void
originYproperty 
originY:Number  [read-write]

Relative displacement of a texture's origin along its Y axis.

The default value is 0.5.

Implementation
    public function get originY():Number
    public function set originY(value:Number):void
smoothproperty 
smooth:Boolean  [read-write]

Texture smoothing.

Implementation
    public function get smooth():Boolean
    public function set smooth(value:Boolean):void
textureproperty 
texture:Texture  [read-write]

A texture to draw.

Implementation
    public function get texture():Texture
    public function set texture(value:Texture):void
Constructor detail
SpriteTextureMaterial()constructor
public function SpriteTextureMaterial(texture:Texture, alpha:Number = 1, smooth:Boolean = false, blendMode:String, originX:Number = 0.5, originY:Number = 0.5)

Creates an instance of the class.

Parameters
texture:Texturea texture to draw
 
alpha:Number (default = 1)material opacity
 
smooth:Boolean (default = false)texture smoothing
 
blendMode:Stringcolor blending mode
 
originX:Number (default = 0.5)relative displacement of a texture's origin along its X axis
 
originY:Number (default = 0.5)relative displacement of a texture's origin along its Y axis
Method detail
clone()method
public override function clone():Material

Clones material.

Returns
Materiala clone of the material object