Animated Opening – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "== Overview == The ''Animated Opening'' framework allows you to easily create campaign openings by animating pictures using a timeline. Features * Easy to setup * Timeline ba...")
 
Line 75: Line 75:
| (OPTIONAL) - CODE or ARRAY: code or array of codes to be executed once the timeline is finshed. The codes are CALLed one after the other.
| (OPTIONAL) - CODE or ARRAY: code or array of codes to be executed once the timeline is finshed. The codes are CALLed one after the other.
|}
|}
<hr />


=== BIS_fnc_animatedScreen ===
=== BIS_fnc_animatedScreen ===
Line 82: Line 84:
* Can animate pictures and texts in several ways (scaling, moving, rotating, etc...)
* Can animate pictures and texts in several ways (scaling, moving, rotating, etc...)
* Operates in different ways depending on which parameters are passed
* Operates in different ways depending on which parameters are passed
==== Init mode ====
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_INIT"
| Mode used for initializing the framework
|-
| layers
|
(opt) NUMBER or ARRAY:
* if Number: number of picture layers which will be created
* if Array:
** Select 0: NUMBER of picture layers
** Select 1: NUMBER of text layers
** Select 2: NUMBER of overlay layers
|-
| overscale
|
|-
| contentRatio
|
|}
==== Reset mode ====
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_RESET"
| Mode used for clearing all the initialized layers (all pictures and texts are removed but layers will still exist)
|-
| flags
|
ARRAY: array of 3 BOOL values for picture layers, text layers and overlay layers. If true, deletes the controls in these layers.
* Select 0: reset Picture layers
* Select 1: reset Text layers
* Select 2: reset Overlay layers
|}
==== Layer Create mode ====
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_LAYER_CREATE"
| Mode used for creating layers containing pictures
|-
| layer
| NUMBER: ID of the layer
|-
| texture
| STRING: Path to the picture to be displayed
|-
| posCenter
| (opt) ARRAY: Center position of the picture in x,y coordinates
|-
| alpha
| (opt) NUMBER: Alpha of the picture (1 = fully visible)
|-
| scale
| (opt) NUMBER: Scale of the picture (1 = original size)
|}
==== Layer Animate mode ====
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_LAYER_ANIMATE"
| Mode used for animating layers containing pictures
|-
| layer
| NUMBER: ID of the layer
|-
| duration
| (opt) NUMBER: Duration of the animation
|-
| posCenterEnd
| (opt) ARRAY: Final position of the picture's center in x,y coordinates
|-
| scaleEnd
| (opt) NUMBER: Final scale amount of the picture
|-
| posCenterStart
| (opt) ARRAY: Initial position of the picture's center in x,y coordinates
|-
| scaleStart
| (opt) NUMBER: Initial scale amount of the picture
|}
==== Layer Rotate mode ====
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_LAYER_ROTATE"
| Mode used for rotating layers
|-
| layer
| NUMBER: ID of the layer
|-
| duration
| NUMBER: Duration of the animation
|-
| angleDelta
| NUMBER: Desired amount of rotation
|-
| angleStart
| (opt) NUMBER: Initial rotation amount
|}
==== Layer Fade mode ====
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_LAYER_FADE"
| Mode used for layers
|-
| layer
| NUMBER: ID of the layer
|-
| duration
| NUMBER: Duration of the animation
|-
| alphaEnd
| (opt) NUMBER: Final alpha of the layer
|-
| alphaStart
| (opt) NUMBER: Initial alpha of the layer
|}
==== Layer Pulse mode ====
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_LAYER_PULSE"
| Mode used for fading from and to different alpha values in a cyclic manner
|-
| layer
| NUMBER: ID of the layer
|-
| duration
| NUMBER: Duration of the animation
|-
| alpha1
| (opt) NUMBER: First alpha value
|-
| alpha2
| (opt) NUMBER: Second alpha value
|-
| cycles
| (opt) NUMBER: Number of cycles/times the animation will happen (a full cycle consists of the layer fading to alpha1 and then to alpha2)
|}
==== Text Create mode ====


{| class="wikitable"
{| class="wikitable"
Line 88: Line 270:
! Description
! Description
|-
|-
| timeline
| mode = "MODE_TEXT_CREATE"
| 2D ARRAY: array with keyframes and code to be activated at a certain time
| Mode used for creating layers containing text
|-
| layer
| NUMBER: ID of the layer
|-
|-
| pointer
| text
| NUMBER: where to start playing (index)
| (opt) STRING: Text content
|-
| position
| (opt) ARRAY: Text position in x,y coordinates
|-
| align
| (opt) NUMBER: Text alignment. Options are: ALIGN_TOPLEFT, ALIGN_BOTTOMLEFT, ALIGN_LEFT, ALIGN_TOP, ALIGN_CENTER, ALIGN_BOTTOM, ALIGN_TOPRIGHT, ALIGN_RIGHT, ALIGN_BOTTOMRIGHT
|-
| color
| (opt) ARRAY: Color of the text in r,g,b,a format
|-
| alpha
| (opt) NUMBER: Alpha of the text
|-
| tagSize
| (opt) NUMBER: Size of the text
|-
| tagShadow
| (opt) NUMBER: Shadow style
|-
| tagFont
| (opt) STRING: Text font
|}
 
 
==== Text Animate mode ====
 
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_TEXT_ANIMATE"
| Mode used for animating layers containing text
|-
| layer
| NUMBER: ID of the layer
|-
| duration
| (opt) NUMBER: Duration of the animation
|-
| posEnd
| (opt) ARRAY: Final position of the text in x,y coordinates
|-
| scaleEnd
| (opt) NUMBER: Final text scale
|-
| alphaEnd
| (opt) NUMBER: Final text alpha
|-
| posStart
| (opt) ARRAY: Initial position of the text in x,y coordinates
|-
| scaleStart
| (opt) NUMBER: Initial text scale
|-
| alphaStart
| (opt) NUMBER: Initial text alpha
|}
 
 
==== Create Overlay mode ====
 
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_OVERLAY_CREATE"
| Mode used for creating layers for overlays
|-
| layer
| NUMBER: ID of the layer
|-
| text
| (opt) STRING: Text content
|-
| position
| (opt) ARRAY: Position in x,y coordinates
|-
| align
| (opt) NUMBER: Text alignment. Options are: ALIGN_TOPLEFT, ALIGN_BOTTOMLEFT, ALIGN_LEFT, ALIGN_TOP, ALIGN_CENTER, ALIGN_BOTTOM, ALIGN_TOPRIGHT, ALIGN_RIGHT, ALIGN_BOTTOMRIGHT
|-
| color
| (opt) ARRAY: Color of the text in r,g,b,a format
|-
| alpha
| (opt) NUMBER: Alpha of the text
|-
| tagSize
| (opt) NUMBER: Size of the text
|-
| tagShadow
| (opt) NUMBER: Shadow style
|-
| tagFont
| (opt) STRING: Text font
|}
 
 
==== Create Skybox mode ====
 
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_SKYBOX_CREATE"
|
|-
| layer
| NUMBER: ID of the layer
|-
| texture
| STRING: Path to the picture to be displayed
|-
| alpha
| (opt) NUMBER: Alpha of the picture (1 = fully visible)
|-
| duration
|
|}
 
 
==== Destroy mode ====
 
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_DESTROY"
| Mode used for terminating animations and destroying all layers
|}
 
 
==== BlackOut mode ====
 
{| class="wikitable"
|-
! Parameter
! Description
|-
| mode = "MODE_BLACKOUT"
| Mode used for fading out the screen to black
|-
| duration
| (opt) NUMBER: Duration of the fade out time
|-
| wait
| (opt) BOOL: If true, script sleeps until the fading is complete
|}
 
 
==== BlackIn mode ====
 
{| class="wikitable"
|-
! Parameter
! Description
|-
|-
| music
| mode = "MODE_BLACKIN"
| (OPTIONAL) - STRING: music to be played which will provide the sync time for the timeline
| Mode used for fading in the screen from black
|-
|-
| codeInterrupt
| duration
| (OPTIONAL) - CODE: code to be executed if the timeline is interrupted (missionNamespace setVariable ["BIS_fnc_eventTimeline_play", FALSE])
| (opt) NUMBER: Duration of the fade in time
|-
|-
| codeStop
| wait
| (OPTIONAL) - CODE or ARRAY: code or array of codes to be executed once the timeline is finshed. The codes are CALLed one after the other.
| (opt) BOOL: If true, script sleeps until the fading is complete
|}
|}

Revision as of 15:10, 30 November 2017

Overview

The Animated Opening framework allows you to easily create campaign openings by animating pictures using a timeline.

Features

  • Easy to setup
  • Timeline based
  • Can be easily synced to music or dialogues using the timeline
  • Skippable

Framework

Functionality

The framework provides the designer with simple ways to manage picture and texts and to quickly animate them efficiently. The framework also lets you organize pictures and text in layers so that you can easily manage which pictures stay on top on which stay on the bottom. It provides several ways to animate pictures: scaling, moving, rotating, blinking/pulsing and fading.

Systems

BIS_fnc_TO_AnimatedOpening

  • Enhanced version of the BIS_fnc_eventTimeline function
  • Sets up the opening
    • Initializes the animatedScreen function
    • Creates the initial black out
    • starts the event timeline by calling BIS_fnc_eventTimeline function
    • holdKey setup (for skipping the opening)

Parameters

Parameter Description
timeline 2D ARRAY: see BIS_fnc_eventTimeline
pointer NUMBER: see BIS_fnc_eventTimeline
music (opt) - STRING: see BIS_fnc_eventTimeline

BIS_fnc_eventTimeline

  • Essential system of the Animated Briefings, but the function can be used for different purposes
  • It executes the code fragments at given time (keyframes)
  • It can play the events from start or from a defined position (index)
  • It can be interrupted from outside
  • user defined code can be executed onInterrupt or onFinished


Parameters

Parameter Description
timeline 2D ARRAY: array with keyframes and code to be activated at a certain time
pointer NUMBER: where to start playing (index)
music (OPTIONAL) - STRING: music to be played which will provide the sync time for the timeline
codeInterrupt (OPTIONAL) - CODE: code to be executed if the timeline is interrupted (missionNamespace setVariable ["BIS_fnc_eventTimeline_play", FALSE])
codeStop (OPTIONAL) - CODE or ARRAY: code or array of codes to be executed once the timeline is finshed. The codes are CALLed one after the other.

BIS_fnc_animatedScreen

  • Handles pictures, texts, layers, animations
  • Provides ways to create, destroy, reset all layers
  • Can animate pictures and texts in several ways (scaling, moving, rotating, etc...)
  • Operates in different ways depending on which parameters are passed

Init mode

Parameter Description
mode = "MODE_INIT" Mode used for initializing the framework
layers

(opt) NUMBER or ARRAY:

  • if Number: number of picture layers which will be created
  • if Array:
    • Select 0: NUMBER of picture layers
    • Select 1: NUMBER of text layers
    • Select 2: NUMBER of overlay layers
overscale
contentRatio


Reset mode

Parameter Description
mode = "MODE_RESET" Mode used for clearing all the initialized layers (all pictures and texts are removed but layers will still exist)
flags

ARRAY: array of 3 BOOL values for picture layers, text layers and overlay layers. If true, deletes the controls in these layers.

  • Select 0: reset Picture layers
  • Select 1: reset Text layers
  • Select 2: reset Overlay layers


Layer Create mode

Parameter Description
mode = "MODE_LAYER_CREATE" Mode used for creating layers containing pictures
layer NUMBER: ID of the layer
texture STRING: Path to the picture to be displayed
posCenter (opt) ARRAY: Center position of the picture in x,y coordinates
alpha (opt) NUMBER: Alpha of the picture (1 = fully visible)
scale (opt) NUMBER: Scale of the picture (1 = original size)


Layer Animate mode

Parameter Description
mode = "MODE_LAYER_ANIMATE" Mode used for animating layers containing pictures
layer NUMBER: ID of the layer
duration (opt) NUMBER: Duration of the animation
posCenterEnd (opt) ARRAY: Final position of the picture's center in x,y coordinates
scaleEnd (opt) NUMBER: Final scale amount of the picture
posCenterStart (opt) ARRAY: Initial position of the picture's center in x,y coordinates
scaleStart (opt) NUMBER: Initial scale amount of the picture


Layer Rotate mode

Parameter Description
mode = "MODE_LAYER_ROTATE" Mode used for rotating layers
layer NUMBER: ID of the layer
duration NUMBER: Duration of the animation
angleDelta NUMBER: Desired amount of rotation
angleStart (opt) NUMBER: Initial rotation amount


Layer Fade mode

Parameter Description
mode = "MODE_LAYER_FADE" Mode used for layers
layer NUMBER: ID of the layer
duration NUMBER: Duration of the animation
alphaEnd (opt) NUMBER: Final alpha of the layer
alphaStart (opt) NUMBER: Initial alpha of the layer


Layer Pulse mode

Parameter Description
mode = "MODE_LAYER_PULSE" Mode used for fading from and to different alpha values in a cyclic manner
layer NUMBER: ID of the layer
duration NUMBER: Duration of the animation
alpha1 (opt) NUMBER: First alpha value
alpha2 (opt) NUMBER: Second alpha value
cycles (opt) NUMBER: Number of cycles/times the animation will happen (a full cycle consists of the layer fading to alpha1 and then to alpha2)


Text Create mode

Parameter Description
mode = "MODE_TEXT_CREATE" Mode used for creating layers containing text
layer NUMBER: ID of the layer
text (opt) STRING: Text content
position (opt) ARRAY: Text position in x,y coordinates
align (opt) NUMBER: Text alignment. Options are: ALIGN_TOPLEFT, ALIGN_BOTTOMLEFT, ALIGN_LEFT, ALIGN_TOP, ALIGN_CENTER, ALIGN_BOTTOM, ALIGN_TOPRIGHT, ALIGN_RIGHT, ALIGN_BOTTOMRIGHT
color (opt) ARRAY: Color of the text in r,g,b,a format
alpha (opt) NUMBER: Alpha of the text
tagSize (opt) NUMBER: Size of the text
tagShadow (opt) NUMBER: Shadow style
tagFont (opt) STRING: Text font


Text Animate mode

Parameter Description
mode = "MODE_TEXT_ANIMATE" Mode used for animating layers containing text
layer NUMBER: ID of the layer
duration (opt) NUMBER: Duration of the animation
posEnd (opt) ARRAY: Final position of the text in x,y coordinates
scaleEnd (opt) NUMBER: Final text scale
alphaEnd (opt) NUMBER: Final text alpha
posStart (opt) ARRAY: Initial position of the text in x,y coordinates
scaleStart (opt) NUMBER: Initial text scale
alphaStart (opt) NUMBER: Initial text alpha


Create Overlay mode

Parameter Description
mode = "MODE_OVERLAY_CREATE" Mode used for creating layers for overlays
layer NUMBER: ID of the layer
text (opt) STRING: Text content
position (opt) ARRAY: Position in x,y coordinates
align (opt) NUMBER: Text alignment. Options are: ALIGN_TOPLEFT, ALIGN_BOTTOMLEFT, ALIGN_LEFT, ALIGN_TOP, ALIGN_CENTER, ALIGN_BOTTOM, ALIGN_TOPRIGHT, ALIGN_RIGHT, ALIGN_BOTTOMRIGHT
color (opt) ARRAY: Color of the text in r,g,b,a format
alpha (opt) NUMBER: Alpha of the text
tagSize (opt) NUMBER: Size of the text
tagShadow (opt) NUMBER: Shadow style
tagFont (opt) STRING: Text font


Create Skybox mode

Parameter Description
mode = "MODE_SKYBOX_CREATE"
layer NUMBER: ID of the layer
texture STRING: Path to the picture to be displayed
alpha (opt) NUMBER: Alpha of the picture (1 = fully visible)
duration


Destroy mode

Parameter Description
mode = "MODE_DESTROY" Mode used for terminating animations and destroying all layers


BlackOut mode

Parameter Description
mode = "MODE_BLACKOUT" Mode used for fading out the screen to black
duration (opt) NUMBER: Duration of the fade out time
wait (opt) BOOL: If true, script sleeps until the fading is complete


BlackIn mode

Parameter Description
mode = "MODE_BLACKIN" Mode used for fading in the screen from black
duration (opt) NUMBER: Duration of the fade in time
wait (opt) BOOL: If true, script sleeps until the fading is complete