class Texture extends BaseTexture
A texture stores the information that represents an image or part of an image. It cannot be added to the display list directly. Instead use it as the texture for a Sprite. If no frame is provided then the whole image is used.
- Annotations
- @RawJSType() @native() @JSName( "Texture" )
- Alphabetic
- By Inheritance
- Texture
- BaseTexture
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
Texture(baseTexture: BaseTexture, frame: Rectangle = js.native, crop: Rectangle = js.native, trim: Rectangle = js.native, rotate: Rectangle = js.native)
- baseTexture
The base texture source to create the texture from
- frame
The rectangle frame of the texture to show
- crop
The area of original texture
- trim
Trimmed texture rectangle
- rotate
indicates whether the texture should be rotated by 90 degrees ( used by texture packer )
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- var baseTexture: BaseTexture
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- var crop: Rectangle
-
def
destroy(): Unit
Destroys this base texture
Destroys this base texture
- Definition Classes
- BaseTexture
-
def
dispose(): Unit
Frees the texture from WebGL memory without destroying this texture object.
Frees the texture from WebGL memory without destroying this texture object. This means you can still use the texture later which will upload it to GPU memory again.
- Definition Classes
- BaseTexture
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- var frame: Rectangle
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hasLoaded: Boolean
Set to true once the base texture has successfully loaded.
Set to true once the base texture has successfully loaded. This is never true if the underlying source fails to load or has no texture data.
- Definition Classes
- BaseTexture
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
height: Double
The height of the base texture set when the image has loaded
The height of the base texture set when the image has loaded
- Definition Classes
- BaseTexture
-
var
imageUrlstring: String
TODO
TODO
- Definition Classes
- BaseTexture
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isLoading: Boolean
Set to true if the source is currently loading.
Set to true if the source is currently loading. If an Image source is loading the 'loaded' or 'error' event will be dispatched when the operation ends. An underyling source that is immediately-available bypasses loading entirely.
- Definition Classes
- BaseTexture
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
loadSource(source: |[Image, HTMLCanvasElement]): Unit
Load a source.
Load a source. If the source is not-immediately-available, such as an image that needs to be downloaded, then the 'loaded' or 'error' event will be dispatched in the future and hasLoaded will remain false after this call.
- source
the source object of the texture.
- Definition Classes
- BaseTexture
-
var
mipmap: Boolean
Set this to true if a mipmap of this texture needs to be generated.
Set this to true if a mipmap of this texture needs to be generated. This value needs to be set before the texture is used Also the texture must be a power of two size to work.
- Definition Classes
- BaseTexture
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
on(event: String, callback: Function): Texture.this.type
- Definition Classes
- BaseTexture
-
var
premultipliedAlpha: Boolean
Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)
Controls if RGB channels should be pre-multiplied by Alpha (WebGL only)
- Definition Classes
- BaseTexture
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
realHeight: Double
Used to store the actual height of the source of this texture
Used to store the actual height of the source of this texture
- Definition Classes
- BaseTexture
-
def
realWidth: Double
Used to store the actual width of the source of this texture
Used to store the actual width of the source of this texture
- Definition Classes
- BaseTexture
-
var
resolution: Resolution
The Resolution of the texture.
The Resolution of the texture.
- Definition Classes
- BaseTexture
- var rotate: Rectangle
-
var
scaleMode: Int
The scale mode to apply when scaling this texture
The scale mode to apply when scaling this texture
- Definition Classes
- BaseTexture
- See also
-
def
source: Any
The image source that is used to create the texture.
The image source that is used to create the texture.
- returns
an image or the canvas
- Definition Classes
- BaseTexture
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- var trim: Rectangle
-
def
update(): Unit
Updates the texture on all the webgl renderers, this also assumes the src has changed.
Updates the texture on all the webgl renderers, this also assumes the src has changed.
- Definition Classes
- BaseTexture
-
def
updateSourceImage(newSrc: String): Unit
Changes the source image of the texture.
Changes the source image of the texture. The original source must be an Image element.
- newSrc
the path of the image
- Definition Classes
- BaseTexture
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
width: Double
The width of the base texture set when the image has loaded
The width of the base texture set when the image has loaded
- Definition Classes
- BaseTexture