SceneLight

SceneLight

new SceneLight(light)

场景光源对象

Source:
Parameters:
Name Type Description
light Object

场景中预设的光源数据

Members

anchorOffsetX :number

区域光源锚点水平偏移

Source:
Type:
  • number

anchorOffsetY :number

区域光源锚点垂直偏移

Source:
Type:
  • number

anchorX :number

区域光源锚点X

Source:
Type:
  • number

anchorY :number

区域光源锚点Y

Source:
Type:
  • number

angle :number

区域光源角度(degrees)

Source:
Type:
  • number

blend :string

场景光源混合模式

Source:
Type:
  • string

blue :number

光线颜色-蓝(0-255)

Source:
Type:
  • number

direct :number

直射率(0-1)

Source:
Type:
  • number

events :Object

场景光源事件映射表

Source:
Type:

green :number

光线颜色-绿(0-255)

Source:
Type:
  • number

height :number

区域光源高度

Source:
Type:
  • number

intensity :number

点光源强度(0-1)

Source:
Type:
  • number

latest :SceneLight|undefined

最新创建光源

Source:
Type:

mask :string

蒙版图像文件ID

Source:
Type:
  • string

measureHeight :number

区域光源测量外接矩形高度

Source:
Type:
  • number

measureOffsetX :number

区域光源测量外接矩形水平偏移

Source:
Type:
  • number

measureOffsetY :number

区域光源测量外接矩形垂直偏移

Source:
Type:
  • number

measureWidth :number

区域光源测量外接矩形宽度

Source:
Type:
  • number

moved :boolean

场景光源是否已经移动

Source:
Type:
  • boolean

name :string

场景光源名称

Source:
Type:
  • string

parent :SceneLightManager|null

场景光源的父级对象

Source:
Type:

presetId :string

场景光源预设数据ID

Source:
Type:
  • string

range :number

点光源照亮范围(直径)

Source:
Type:
  • number

red :number

光线颜色-红(0-255)

Source:
Type:
  • number

script :Script

场景光源脚本管理器

Source:
Type:

selfVarId :string

场景光源独立变量ID

Source:
Type:
  • string

started :boolean

已开始状态

Source:
Type:
  • boolean

texture :ImageTexture|null

区域光源图像纹理

Source:
Type:

type :string

场景光源类型

Source:
Type:
  • string

updaters :ModuleList

场景光源更新器模块列表

Source:
Type:

visible :boolean

场景光源可见性

Source:
Type:
  • boolean

width :number

区域光源宽度

Source:
Type:
  • number

x :number

场景光源水平位置

Source:
Type:
  • number

y :number

场景光源垂直位置

Source:
Type:
  • number

Methods

callEvent(type) → {EventHandler|undefined}

调用场景光源事件

Source:
Parameters:
Name Type Description
type string

场景光源事件类型

Returns:
Type:
EventHandler | undefined

destroy()

销毁场景光源

Source:

draw(projMatrix, opacity)

绘制场景光源

Source:
Parameters:
Name Type Description
projMatrix Matrix

投影矩阵

opacity number

不透明度

drawAreaLight(projMatrix, opacity)

绘制区域光源

Source:
Parameters:
Name Type Description
projMatrix Matrix

投影矩阵

opacity number

不透明度

drawPointLight(projMatrix, opacity)

绘制点光源

Source:
Parameters:
Name Type Description
projMatrix Matrix

投影矩阵

opacity number

不透明度

emit(type)

调用场景光源事件和脚本

Source:
Parameters:
Name Type Description
type string

场景光源事件类型

measure()

测量区域光源的外接矩形(用于做绘制条件判断)

Source:

move(properties, easingId, duration)

移动场景光源

Source:
Parameters:
Name Type Description
properties Array.<string, number>

光源属性词条

easingId string

过渡曲线ID

duration number

持续时间(毫秒)

saveData()

保存场景光源数据

Source:

update(deltaTime)

更新场景光源

Source:
Parameters:
Name Type Description
deltaTime number

增量时间(毫秒)