new Blend(config)
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | configuration , see createDefaultConfig() for default values
Properties
|
Extends
Members
(static) EVENTS
Properties:
| Type | Description |
|---|---|
| Blend.EVENTS__TYPE |
(static) FIT
Properties:
| Type | Description |
|---|---|
| Blend.FIT__TYPE |
(static) TOUCH_MODE
Properties:
| Type | Description |
|---|---|
| Blend.TOUCH_MODE__TYPE |
blend
Properties:
| Name | Type | Description |
|---|---|---|
blend |
number | sets blend value in shader |
- Overrides:
- Source:
cellIndex1
Properties:
| Name | Type | Description |
|---|---|---|
cellIndex1 |
integer | sets cellIndex1 value in shader. cellIndex1 is the video-spritesheet cellIndex blended FROM |
- Overrides:
- Source:
cellIndex2
Properties:
| Name | Type | Description |
|---|---|---|
cellIndex2 |
integer | sets cellIndex2 value in shader. cellIndex2 is the video-spritesheet cellIndex blended TO |
- Overrides:
- Source:
EVENTS
Properties:
| Type | Description |
|---|---|
| Blend.EVENTS__TYPE |
- Overrides:
- Source:
FIT
Properties:
| Type | Description |
|---|---|
| Blend.FIT__TYPE |
- Overrides:
- Source:
maxRadius
Properties:
| Name | Type | Description |
|---|---|---|
maxRadius |
number | sets maxRadius value in shader. maxRadius is a viewport-unit setting for the maximum blend radius |
- Inherited From:
- Source:
- See:
-
- config.autoMaxRadius - set to true, will auto-calculate/update this value to the minimum full-coverage size
radiusBleed
Properties:
| Name | Type | Description |
|---|---|---|
radiusBleed |
number | sets radiusBleed value in shader. changes the radial effect bleed width |
- Overrides:
- Source:
resolutionX
Properties:
| Name | Type | Description |
|---|---|---|
resolutionX |
number | sets resolutionX value in shader. auto-calculated/updated based on canvas size |
- Inherited From:
- Source:
resolutionY
Properties:
| Name | Type | Description |
|---|---|---|
resolutionY |
number | sets resolutionY value in shader. auto-calculated/updated based on canvas size |
- Inherited From:
- Source:
TOUCH_MODE
Properties:
| Type | Description |
|---|---|
| Blend.TOUCH_MODE__TYPE |
touchX
Properties:
| Name | Type | Description |
|---|---|---|
touchX |
number | sets touchX value in shader. touchX,touchY are used as a radial effect center |
- Overrides:
- Source:
touchY
Properties:
| Name | Type | Description |
|---|---|---|
touchY |
number | sets touchX value in shader. touchX,touchY are used as a radial effect center |
- Overrides:
- Source:
uvTrim
Properties:
| Name | Type | Description |
|---|---|---|
uvTrim |
number | sets uvTrim value in shader. |
- Inherited From:
- Source:
- See:
-
- config.cellUVTrim - set initially by this config value
videoScaleX
Properties:
| Name | Type | Description |
|---|---|---|
videoScaleX |
number | sets videoScaleX value in shader. auto-calculated/updated based on canvas size/video-aspect in accordance to config.fit |
- Inherited From:
- Source:
videoScaleY
Properties:
| Name | Type | Description |
|---|---|---|
videoScaleY |
number | sets videoScaleY value in shader. auto-calculated/updated based on canvas size/video-aspect in accordance to config.fit |
- Inherited From:
- Source:
Methods
destroy()
as advertised
- Overrides:
- Source:
toggleBlend(onCompleteopt, tweenPropsopt)
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
onComplete |
function |
<optional> |
|||||||||||||
tweenProps |
object |
<optional> |
TweenMax props for transition of blend
Properties
|
transitionToIndex(fromIndex, toIndex, nextIndex2, onCompleteopt, tweenPropsopt)
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fromIndex |
integer | ||||||||||||||
toIndex |
integer | ||||||||||||||
nextIndex2 |
integer | ||||||||||||||
onComplete |
function |
<optional> |
|||||||||||||
tweenProps |
object |
<optional> |
TweenMax props for transition of blend
if not provided - uses config tweenProps
Properties
|
tweenBlend({number, onCompleteopt, tweenPropsopt)
tweens to a given blend value
Parameters:
| Name | Type | Attributes | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{number |
blend = (0 to 1) | ||||||||||||||
onComplete |
function |
<optional> |
|||||||||||||
tweenProps |
object |
<optional> |
TweenMax props for transition of blend
if not provided - uses config tweenProps
Properties
|
update()
raf, extended from BaseBlend
updateBlend(target)
called per frame, updates any touch behaviour
Parameters:
| Name | Type | Description |
|---|---|---|
target |
number | blend value to bias/ease to |
updateTouch()
called per frame, updates any touch behaviour
Type Definitions
EVENTS__TYPE
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
BLEND_UNIT |
string | emitted on blend value change. event value:number (0 to 1) |
BLEND_TOUCH |
string | emitted on touch or mousedown. event value: none |
BLEND_TRANSITION_COMPLETE |
string | emitted on blend value =1. can use to switch video cell targets. event value: none |
FIT__TYPE
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
COVER |
string | fill frame, maintain aspect ratio |
CONTAIN |
string | fit within frame, maintain aspect ratio |
STRETCH |
string | stretch to frame, dont maintain aspect ratio |
TOUCH_MODE__TYPE
Type:
- object
Properties:
| Name | Type | Description |
|---|---|---|
NONE |
string | for external-only control of touch/blend events |
HOLD |
string | transition to index2 on hold - transition to index1 on release |
HOLD_THRESHOLD |
string | trigger transition to index2 on hold duration, then index1 = index2. if threshold crossed - no release trigger |
TOGGLE |
string | trigger transition to index2 on press, then index1 = index2. no release trigger |