Packagelaya.webgl.canvas
Classpublic class WebGLContext2D
InheritanceWebGLContext2D Inheritance laya.resource.Context



Public Properties
 PropertyDefined By
  asBitmap : Boolean
[write-only]
WebGLContext2D
  _clipRect : Rectangle
WebGLContext2D
  _COUNT : int = 0
[static]
WebGLContext2D
  _curMat : Matrix
WebGLContext2D
  _curSubmit : * = null
WebGLContext2D
  fillStyle : *
WebGLContext2D
  font : String
[override] [write-only]
WebGLContext2D
  globalAlpha : Number
[override]
WebGLContext2D
  globalCompositeOperation : String
[override]
WebGLContext2D
  _ib : IndexBuffer2D = null
WebGLContext2D
  _id : int
WebGLContext2D
  lineWidth : Number
WebGLContext2D
  _nBlendType : int = 0
WebGLContext2D
  _renderKey : Number
WebGLContext2D
  _save : *
WebGLContext2D
  _saveMark : SaveMark = null
WebGLContext2D
  _shader2D : Shader2D = null
WebGLContext2D
  sprite : Sprite
所cacheAs精灵
WebGLContext2D
  strokeStyle : *
WebGLContext2D
  _submits : * = null
WebGLContext2D
  _targets : RenderTargetMAX
WebGLContext2D
  textAlign : String
WebGLContext2D
  textBaseline : String
WebGLContext2D
  _tmpMatrix : Matrix
[static]
WebGLContext2D
  _vb : VertexBuffer2D = null
WebGLContext2D
  _x : Number = 0
WebGLContext2D
  _y : Number = 0
WebGLContext2D
Public Methods
 MethodDefined By
  
WebGLContext2D
  
__init__():void
[static]
WebGLContext2D
  
_drawText(tex:Texture, x:Number, y:Number, width:Number, height:Number, m:Matrix, tx:Number, ty:Number, dx:Number, dy:Number):void
WebGLContext2D
  
_getSubmits():Array
WebGLContext2D
  
WebGLContext2D
  
WebGLContext2D
  
addTextureVb(invb:Array, x:Number, y:Number):void
WebGLContext2D
  
arc(cx:Number, cy:Number, r:Number, startAngle:Number, endAngle:Number, counterclockwise:Boolean = false, b:Boolean = true):void
WebGLContext2D
  
arcTo(x1:Number, y1:Number, x2:Number, y2:Number, r:Number):void
[override]
WebGLContext2D
  
beginPath():void
[override]
WebGLContext2D
  
clear():void
[override]
WebGLContext2D
  
clearBG(r:Number, g:Number, b:Number, a:Number):void
WebGLContext2D
  
clip():void
[override]
WebGLContext2D
  
clipRect(x:Number, y:Number, width:Number, height:Number):void
[override]
WebGLContext2D
  
closePath():void
WebGLContext2D
  
destroy():void
[override]
WebGLContext2D
  
drawCanvas(canvas:HTMLCanvas, x:Number, y:Number, width:Number, height:Number):void
[override]
WebGLContext2D
  
drawCurves(x:Number, y:Number, args:Array):void
[override]
WebGLContext2D
  
drawParticle(x:Number, y:Number, pt:*):void
nd矢量绘制
WebGLContext2D
  
drawPoly(x:Number, y:Number, points:Array, color:uint, lineWidth:Number, boderColor:uint, isConvexPolygon:Boolean = false):void
画多边形(用)
WebGLContext2D
  
drawTarget(scope:*, x:Number, y:Number, width:Number, height:Number, m:Matrix, proName:String, shaderValue:Value2D, uv:Array = null, blend:int = -1):void
WebGLContext2D
  
drawTexture(tex:Texture, x:Number, y:Number, width:Number, height:Number, tx:Number, ty:Number):void
[override]
WebGLContext2D
  
drawTexture2(x:Number, y:Number, pivotX:Number, pivotY:Number, transform:Matrix, alpha:Number, blendMode:String, args:Array):void
[override]
WebGLContext2D
  
drawTextures(tex:Texture, pos:Array, tx:Number, ty:Number):void
[override]
WebGLContext2D
  
drawTextureWithTransform(tex:Texture, x:Number, y:Number, width:Number, height:Number, transform:Matrix, tx:Number, ty:Number, alpha:Number):void
[override]
WebGLContext2D
  
fill(isConvexPolygon:Boolean = false):void
WebGLContext2D
  
fillBorderText(txt:*, x:Number, y:Number, fontStr:String, fillColor:String, borderColor:String, lineWidth:int, textAlign:String):void
[override]
WebGLContext2D
  
fillBorderWords(words:Vector.<HTMLChar>, x:Number, y:Number, font:String, color:String, borderColor:String, lineWidth:int):void
[override]
WebGLContext2D
  
fillQuadrangle(tex:Texture, x:Number, y:Number, point4:Array, m:Matrix):void
WebGLContext2D
  
fillRect(x:Number, y:Number, width:Number, height:Number, fillStyle:*):void
[override]
WebGLContext2D
  
fillText(txt:*, x:Number, y:Number, fontStr:String, color:String, textAlign:String):void
[override]
WebGLContext2D
  
fillTexture(texture:Texture, x:Number, y:Number, width:Number, height:Number, type:String, offset:Point, other:*):void
[override]
WebGLContext2D
  
fillTrangles(tex:Texture, x:Number, y:Number, points:Array, m:Matrix):void
WebGLContext2D
  
fillWords(words:Vector.<HTMLChar>, x:Number, y:Number, fontStr:String, color:String, underLine:int):void
[override]
WebGLContext2D
  
finish():void
WebGLContext2D
  
flush():int
[override]
WebGLContext2D
  
line(fromX:Number, fromY:Number, toX:Number, toY:Number, lineWidth:Number, mat:Matrix):void
WebGLContext2D
  
lineTo(x:Number, y:Number, b:Boolean = true):void
WebGLContext2D
  
movePath(x:Number, y:Number):void
WebGLContext2D
  
moveTo(x:Number, y:Number, b:Boolean = true):void
WebGLContext2D
  
quadraticCurveTo(cpx:Number, cpy:Number, x:Number, y:Number):void
[override]
WebGLContext2D
  
rect(x:Number, y:Number, width:Number, height:Number):void
[override]
WebGLContext2D
  
restore():void
[override]
WebGLContext2D
  
rotate(angle:Number):void
WebGLContext2D
  
save():void
[override]
WebGLContext2D
  
scale(scaleX:Number, scaleY:Number):void
[override]
WebGLContext2D
  
setFilters(value:Array):void
WebGLContext2D
  
setIBVB(x:Number, y:Number, ib:IndexBuffer2D, vb:VertexBuffer2D, numElement:int, mat:Matrix, shader:Shader, shaderValues:Value2D, startIndex:int = 0, offset:int = 0, type:int = 0):void
WebGLContext2D
  
[override]
WebGLContext2D
  
setPathId(id:int):void
WebGLContext2D
  
setShader(shader:Shader):void
WebGLContext2D
  
[override]
WebGLContext2D
  
size(w:Number, h:Number):void
WebGLContext2D
  
stroke():void
[override]
WebGLContext2D
  
strokeRect(x:Number, y:Number, width:Number, height:Number, parameterLineWidth:Number):void
WebGLContext2D
  
strokeText(txt:*, x:Number, y:Number, fontStr:String, color:String, lineWidth:Number, textAlign:String):void
[override]
WebGLContext2D
  
submitElement(start:int, end:int):void
WebGLContext2D
  
transform(a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number):void
[override]
WebGLContext2D
  
[override]
WebGLContext2D
  
translate(x:Number, y:Number):void
[override]
WebGLContext2D
  
willDrawTexture(tex:Texture, alpha:Number):Number
WebGLContext2D
Public Constants
 ConstantDefined By
  MAXCLIPRECT : Rectangle
[static]
WebGLContext2D
  _MAXSIZE : int = 99999999
[static]
WebGLContext2D
  _RECTVBSIZE : int = 16
[static]
WebGLContext2D
  _SUBMITVBSIZE : int = 32000
[static]
WebGLContext2D
  _tempPoint : Point
[static]
WebGLContext2D
Property Detail
_clipRectproperty
public var _clipRect:Rectangle

_COUNTproperty 
public static var _COUNT:int = 0

_curMatproperty 
public var _curMat:Matrix

_curSubmitproperty 
public var _curSubmit:* = null

_ibproperty 
public var _ib:IndexBuffer2D = null

_idproperty 
public var _id:int

_nBlendTypeproperty 
public var _nBlendType:int = 0

_renderKeyproperty 
public var _renderKey:Number

_saveproperty 
public var _save:*

_saveMarkproperty 
public var _saveMark:SaveMark = null

_shader2Dproperty 
public var _shader2D:Shader2D = null

_submitsproperty 
public var _submits:* = null

_targetsproperty 
public var _targets:RenderTargetMAX

_tmpMatrixproperty 
public static var _tmpMatrix:Matrix

_vbproperty 
public var _vb:VertexBuffer2D = null

_xproperty 
public var _x:Number = 0

_yproperty 
public var _y:Number = 0

asBitmapproperty 
asBitmap:Boolean  [write-only]


Implementation
    public function set asBitmap(value:Boolean):void
fillStyleproperty 
fillStyle:*


Implementation
    public function get fillStyle():*
    public function set fillStyle(value:any):void
fontproperty 
font:String  [write-only] [override]


Implementation
    public function set font(value:String):void
globalAlphaproperty 
globalAlpha:Number[override]


Implementation
    public function get globalAlpha():Number
    public function set globalAlpha(value:Number):void
globalCompositeOperationproperty 
globalCompositeOperation:String[override]


Implementation
    public function get globalCompositeOperation():String
    public function set globalCompositeOperation(value:String):void
lineWidthproperty 
lineWidth:Number


Implementation
    public function get lineWidth():Number
    public function set lineWidth(value:Number):void
spriteproperty 
public var sprite:Sprite

所cacheAs精灵

strokeStyleproperty 
strokeStyle:*


Implementation
    public function get strokeStyle():*
    public function set strokeStyle(value:any):void
textAlignproperty 
textAlign:String


Implementation
    public function get textAlign():String
    public function set textAlign(value:String):void
textBaselineproperty 
textBaseline:String


Implementation
    public function get textBaseline():String
    public function set textBaseline(value:String):void
Constructor Detail
WebGLContext2D()Constructor
public function WebGLContext2D(c:HTMLCanvas)



Parameters
c:HTMLCanvas
Method Detail
__init__()method
public static function __init__():void

_drawText()method 
public function _drawText(tex:Texture, x:Number, y:Number, width:Number, height:Number, m:Matrix, tx:Number, ty:Number, dx:Number, dy:Number):void

Parameters

tex:Texture
 
x:Number
 
y:Number
 
width:Number
 
height:Number
 
m:Matrix
 
tx:Number
 
ty:Number
 
dx:Number
 
dy:Number

_getSubmits()method 
public function _getSubmits():Array

Returns
Array
_getTransformMatrix()method 
public function _getTransformMatrix():Matrix

Returns
Matrix
addRenderObject()method 
public function addRenderObject(o:ISubmit):void

Parameters

o:ISubmit

addTextureVb()method 
public function addTextureVb(invb:Array, x:Number, y:Number):void

Parameters

invb:Array
 
x:Number
 
y:Number

arc()method 
public function arc(cx:Number, cy:Number, r:Number, startAngle:Number, endAngle:Number, counterclockwise:Boolean = false, b:Boolean = true):void

Parameters

cx:Number
 
cy:Number
 
r:Number
 
startAngle:Number
 
endAngle:Number
 
counterclockwise:Boolean (default = false)
 
b:Boolean (default = true)

arcTo()method 
override public function arcTo(x1:Number, y1:Number, x2:Number, y2:Number, r:Number):void

Parameters

x1:Number
 
y1:Number
 
x2:Number
 
y2:Number
 
r:Number

beginPath()method 
override public function beginPath():void

clear()method 
override public function clear():void

clearBG()method 
public function clearBG(r:Number, g:Number, b:Number, a:Number):void

Parameters

r:Number
 
g:Number
 
b:Number
 
a:Number

clip()method 
override public function clip():void

clipRect()method 
override public function clipRect(x:Number, y:Number, width:Number, height:Number):void

Parameters

x:Number
 
y:Number
 
width:Number
 
height:Number

closePath()method 
public function closePath():void

destroy()method 
override public function destroy():void

drawCanvas()method 
override public function drawCanvas(canvas:HTMLCanvas, x:Number, y:Number, width:Number, height:Number):void

Parameters

canvas:HTMLCanvas
 
x:Number
 
y:Number
 
width:Number
 
height:Number

drawCurves()method 
override public function drawCurves(x:Number, y:Number, args:Array):void

Parameters

x:Number
 
y:Number
 
args:Array

drawParticle()method 
public function drawParticle(x:Number, y:Number, pt:*):void

nd矢量绘制

Parameters

x:Number
 
y:Number
 
pt:*

drawPoly()method 
public function drawPoly(x:Number, y:Number, points:Array, color:uint, lineWidth:Number, boderColor:uint, isConvexPolygon:Boolean = false):void

画多边形(用)

Parameters

x:Number
 
y:Number
 
points:Array
 
color:uint
 
lineWidth:Number
 
boderColor:uint
 
isConvexPolygon:Boolean (default = false)

drawTarget()method 
public function drawTarget(scope:*, x:Number, y:Number, width:Number, height:Number, m:Matrix, proName:String, shaderValue:Value2D, uv:Array = null, blend:int = -1):void

Parameters

scope:*
 
x:Number
 
y:Number
 
width:Number
 
height:Number
 
m:Matrix
 
proName:String
 
shaderValue:Value2D
 
uv:Array (default = null)
 
blend:int (default = -1)

drawTexture()method 
override public function drawTexture(tex:Texture, x:Number, y:Number, width:Number, height:Number, tx:Number, ty:Number):void

Parameters

tex:Texture
 
x:Number
 
y:Number
 
width:Number
 
height:Number
 
tx:Number
 
ty:Number

drawTexture2()method 
override public function drawTexture2(x:Number, y:Number, pivotX:Number, pivotY:Number, transform:Matrix, alpha:Number, blendMode:String, args:Array):void

Parameters

x:Number
 
y:Number
 
pivotX:Number
 
pivotY:Number
 
transform:Matrix
 
alpha:Number
 
blendMode:String
 
args:Array

drawTextures()method 
override public function drawTextures(tex:Texture, pos:Array, tx:Number, ty:Number):void

Parameters

tex:Texture
 
pos:Array
 
tx:Number
 
ty:Number

drawTextureWithTransform()method 
override public function drawTextureWithTransform(tex:Texture, x:Number, y:Number, width:Number, height:Number, transform:Matrix, tx:Number, ty:Number, alpha:Number):void

Parameters

tex:Texture
 
x:Number
 
y:Number
 
width:Number
 
height:Number
 
transform:Matrix
 
tx:Number
 
ty:Number
 
alpha:Number

fill()method 
public function fill(isConvexPolygon:Boolean = false):void

Parameters

isConvexPolygon:Boolean (default = false)

fillBorderText()method 
override public function fillBorderText(txt:*, x:Number, y:Number, fontStr:String, fillColor:String, borderColor:String, lineWidth:int, textAlign:String):void

Parameters

txt:*
 
x:Number
 
y:Number
 
fontStr:String
 
fillColor:String
 
borderColor:String
 
lineWidth:int
 
textAlign:String

fillBorderWords()method 
override public function fillBorderWords(words:Vector.<HTMLChar>, x:Number, y:Number, font:String, color:String, borderColor:String, lineWidth:int):void

Parameters

words:Vector.<HTMLChar>
 
x:Number
 
y:Number
 
font:String
 
color:String
 
borderColor:String
 
lineWidth:int

fillQuadrangle()method 
public function fillQuadrangle(tex:Texture, x:Number, y:Number, point4:Array, m:Matrix):void

Parameters

tex:Texture
 
x:Number
 
y:Number
 
point4:Array
 
m:Matrix

fillRect()method 
override public function fillRect(x:Number, y:Number, width:Number, height:Number, fillStyle:*):void

Parameters

x:Number
 
y:Number
 
width:Number
 
height:Number
 
fillStyle:*

fillText()method 
override public function fillText(txt:*, x:Number, y:Number, fontStr:String, color:String, textAlign:String):void

Parameters

txt:*
 
x:Number
 
y:Number
 
fontStr:String
 
color:String
 
textAlign:String

fillTexture()method 
override public function fillTexture(texture:Texture, x:Number, y:Number, width:Number, height:Number, type:String, offset:Point, other:*):void

Parameters

texture:Texture
 
x:Number
 
y:Number
 
width:Number
 
height:Number
 
type:String
 
offset:Point
 
other:*

fillTrangles()method 
public function fillTrangles(tex:Texture, x:Number, y:Number, points:Array, m:Matrix):void

Parameters

tex:Texture
 
x:Number
 
y:Number
 
points:Array
 
m:Matrix

fillWords()method 
override public function fillWords(words:Vector.<HTMLChar>, x:Number, y:Number, fontStr:String, color:String, underLine:int):void

Parameters

words:Vector.<HTMLChar>
 
x:Number
 
y:Number
 
fontStr:String
 
color:String
 
underLine:int

finish()method 
public function finish():void

flush()method 
override public function flush():int

Returns
int
line()method 
public function line(fromX:Number, fromY:Number, toX:Number, toY:Number, lineWidth:Number, mat:Matrix):void

Parameters

fromX:Number
 
fromY:Number
 
toX:Number
 
toY:Number
 
lineWidth:Number
 
mat:Matrix

lineTo()method 
public function lineTo(x:Number, y:Number, b:Boolean = true):void

Parameters

x:Number
 
y:Number
 
b:Boolean (default = true)

movePath()method 
public function movePath(x:Number, y:Number):void

Parameters

x:Number
 
y:Number

moveTo()method 
public function moveTo(x:Number, y:Number, b:Boolean = true):void

Parameters

x:Number
 
y:Number
 
b:Boolean (default = true)

quadraticCurveTo()method 
override public function quadraticCurveTo(cpx:Number, cpy:Number, x:Number, y:Number):void

Parameters

cpx:Number
 
cpy:Number
 
x:Number
 
y:Number

rect()method 
override public function rect(x:Number, y:Number, width:Number, height:Number):void

Parameters

x:Number
 
y:Number
 
width:Number
 
height:Number

restore()method 
override public function restore():void

rotate()method 
public function rotate(angle:Number):void

Parameters

angle:Number

save()method 
override public function save():void

scale()method 
override public function scale(scaleX:Number, scaleY:Number):void

Parameters

scaleX:Number
 
scaleY:Number

setFilters()method 
public function setFilters(value:Array):void

Parameters

value:Array

setIBVB()method 
public function setIBVB(x:Number, y:Number, ib:IndexBuffer2D, vb:VertexBuffer2D, numElement:int, mat:Matrix, shader:Shader, shaderValues:Value2D, startIndex:int = 0, offset:int = 0, type:int = 0):void

Parameters

x:Number
 
y:Number
 
ib:IndexBuffer2D
 
vb:VertexBuffer2D
 
numElement:int
 
mat:Matrix
 
shader:Shader
 
shaderValues:Value2D
 
startIndex:int (default = 0)
 
offset:int (default = 0)
 
type:int (default = 0)

setIsMainContext()method 
override public function setIsMainContext():void

setPathId()method 
public function setPathId(id:int):void

Parameters

id:int

setShader()method 
public function setShader(shader:Shader):void

Parameters

shader:Shader

setTransformByMatrix()method 
override public function setTransformByMatrix(value:Matrix):void

Parameters

value:Matrix

size()method 
public function size(w:Number, h:Number):void

Parameters

w:Number
 
h:Number

stroke()method 
override public function stroke():void

strokeRect()method 
public function strokeRect(x:Number, y:Number, width:Number, height:Number, parameterLineWidth:Number):void

Parameters

x:Number
 
y:Number
 
width:Number
 
height:Number
 
parameterLineWidth:Number

strokeText()method 
override public function strokeText(txt:*, x:Number, y:Number, fontStr:String, color:String, lineWidth:Number, textAlign:String):void

Parameters

txt:*
 
x:Number
 
y:Number
 
fontStr:String
 
color:String
 
lineWidth:Number
 
textAlign:String

submitElement()method 
public function submitElement(start:int, end:int):void

Parameters

start:int
 
end:int

transform()method 
override public function transform(a:Number, b:Number, c:Number, d:Number, tx:Number, ty:Number):void

Parameters

a:Number
 
b:Number
 
c:Number
 
d:Number
 
tx:Number
 
ty:Number

transformByMatrix()method 
override public function transformByMatrix(value:Matrix):void

Parameters

value:Matrix

translate()method 
override public function translate(x:Number, y:Number):void

Parameters

x:Number
 
y:Number

willDrawTexture()method 
public function willDrawTexture(tex:Texture, alpha:Number):Number

Parameters

tex:Texture
 
alpha:Number

Returns
Number
Constant Detail
_MAXSIZEConstant
public static const _MAXSIZE:int = 99999999

_RECTVBSIZEConstant 
public static const _RECTVBSIZE:int = 16

_SUBMITVBSIZEConstant 
public static const _SUBMITVBSIZE:int = 32000

_tempPointConstant 
public static const _tempPoint:Point

MAXCLIPRECTConstant 
public static const MAXCLIPRECT:Rectangle