Class: Effects

SG2D.Effects()

Эффекты, в том числе графические шейдеры

Constructor

new Effects()

Source:

Methods

addBevelsToLayer(config) → {SG2D.Effects.Effect}

Добавляет эффект приподнятости

Parameters:
Name Type Description
config object
Properties
Name Type Attributes Default Description
layer string | Number
rotation Number <optional>
135
thickness Number <optional>
2
lightAlpha Number <optional>
0.8
shadowAlpha Number <optional>
0.8
Source:
Returns:
Type
SG2D.Effects.Effect

addDisplacementToLayer(config) → {SG2D.Effects.Effect}

Добавляет эффект искажения

Parameters:
Name Type Description
config object
Properties
Name Type Attributes Default Description
layer string | Number
texture string | PIXI.Texture
scale Number <optional>
1
iterate function <optional>

Колбэк, выполняемый в каждую итерацию (кадр)

animationStep Number <optional>
1

Параметр доступен в iterate() в this.options

Source:
Returns:
Type
SG2D.Effects.Effect

addShadowsToLayer(config) → {SG2D.Effects.Effect}

Добавляет тени

Parameters:
Name Type Description
config object
Properties
Name Type Attributes Default Description
layer string | Number
rotation Number <optional>
135
distance Number <optional>
8
alpha Number <optional>
0.6
Source:
Returns:
Type
SG2D.Effects.Effect

Type Definitions

Effect

Эффект

Type:
  • object
Properties:
Name Type Description
type Number

Тип фильтра: SG2D.Effects.TYPE_SHADOWS | SG2D.Effects.TYPE_BEVELS | SG2D.Effects.TYPE_DISPLACEMENT

layer string | Number
filter PIXI.Filter
options object

Специфические настройки фильтра

Source: