Package | laya.d3.resource |
Class | public class DataTexture2D |
Inheritance | DataTexture2D BaseTexture laya.resource.Resource |
Property | Defined By | ||
---|---|---|---|
defaulteTexture : BaseTexture [read-only]
获取纹理资源。
| BaseTexture | ||
format : int [read-only]
纹理格式
| BaseTexture | ||
height : int [read-only]
获取高度。
| BaseTexture | ||
magFifter : int
放大过滤器
| BaseTexture | ||
minFifter : int
缩小过滤器
| BaseTexture | ||
mipmap : Boolean
是否使用mipLevel
| BaseTexture | ||
repeat : Boolean
是否使用重复模式纹理寻址
| BaseTexture | ||
simLodInfo : Float32Array | DataTexture2D | ||
simLodRect : Uint32Array [static] | DataTexture2D | ||
size : Size [read-only]
获取尺寸。
| BaseTexture | ||
source : * [read-only]
获取纹理资源。
| BaseTexture | ||
src : String [read-only]
获取文件路径全名。
| DataTexture2D | ||
width : int [read-only]
获取宽度。
| BaseTexture |
Method | Defined By | ||
---|---|---|---|
创建一个 Texture2D 实例。
| DataTexture2D | ||
create(data:ArrayBuffer, w:int, h:int, magfilter:int, minfilter:int, mipmap:Boolean = true):DataTexture2D [static] | DataTexture2D | ||
getPixels():Uint8Array
返回图片像素。
| DataTexture2D | ||
load(url:String, w:int = 0, h:int = 0, magfilter:int, minfilter:int):DataTexture2D [static]
加载Texture2D。
| DataTexture2D | ||
onAsynLoaded(url:String, data:*, params:Array):void [override]
private
| DataTexture2D |
Method | Defined By | ||
---|---|---|---|
detoryResource():void [override]
销毁资源。
| DataTexture2D | ||
recreateResource():void [override]
重新创建资源,如果异步创建中被强制释放再创建,则需等待释放完成后再重新加载创建。
| DataTexture2D |
simLodInfo | property |
public var simLodInfo:Float32Array
simLodRect | property |
public static var simLodRect:Uint32Array
src | property |
src:String
[read-only] 获取文件路径全名。
public function get src():String
DataTexture2D | () | Constructor |
public function DataTexture2D()
创建一个 Texture2D
实例。
create | () | method |
public static function create(data:ArrayBuffer, w:int, h:int, magfilter:int, minfilter:int, mipmap:Boolean = true):DataTexture2D
Parameters
data:ArrayBuffer | |
w:int | |
h:int | |
magfilter:int (default = NaN )
| |
minfilter:int (default = NaN )
| |
mipmap:Boolean (default = true )
|
DataTexture2D |
detoryResource | () | method |
override protected function detoryResource():void
销毁资源。
getPixels | () | method |
public function getPixels():Uint8Array
返回图片像素。
ReturnsUint8Array — 图片像素。
|
load | () | method |
public static function load(url:String, w:int = 0, h:int = 0, magfilter:int, minfilter:int):DataTexture2D
加载Texture2D。
Parameters
url:String — Texture2D地址。
| |
w:int (default = 0 )
| |
h:int (default = 0 )
| |
magfilter:int (default = NaN )
| |
minfilter:int (default = NaN )
|
DataTexture2D |
onAsynLoaded | () | method |
override public function onAsynLoaded(url:String, data:*, params:Array):void
private
Parameters
url:String | |
data:* | |
params:Array |
recreateResource | () | method |
override protected function recreateResource():void
重新创建资源,如果异步创建中被强制释放再创建,则需等待释放完成后再重新加载创建。