Logo Logo en
  • iRidi Pro
    Основные компоненты
    • Приложение i3 Pro
    • iRidi Pro Server
    • iRidi Studio
    • iRidium studio v. 1.3.8 (устаревшая версия)
    Java Script в iRidi
    • Руководство
    • Справочник
    • Примеры
    • JS драйвера
    другие
    • Личный Кабинет
    • iRidium Cloud
    • iRidium Transfer
    • Push-уведомления
    • Лучшая практика
    Лицензирование
    • Лицензирование и передача проекта
    • Оффлайн-лицензирование
    • Активация iRidi Pro Server
  • Продукты
    i3 lite
    • Приложение i3 lite
    • Регистрация и лицензирование
    • Сервер
    • Модули
    KNX Home Server
    • Приложение i3 KNX
    • KNX Home Server
    BUS77 HOME SERVER
    • Приложения Bus77 Home и Bus77 Lite
    • Bus77 Home Server
    Решения
    • BYOD - решение для гостиниц
    • Портал жителя - решение для МКД
    iRidi SCADA
    • iRidi SCADA
  • Bus77
    НАСТРОЙКА BUS77
    • Основы Bus77
    • Приложения Bus77 Home и Bus77 Lite
    • Работа с драйвером Bus77 в iRidi Studio
    • Настройка шины Bus77 в iRidi Studio
    ПРОТОКОЛ BUS77
    • Характеристики CAN (Bus77)
    • Описание протокола
    • Исходники на GitHub
    ОБОРУДОВАНИЕ BUS77
    • Каталог Bus77 Pro
    • Каталог Bus77 Lite
  • Поддерживаемое оборудование
    Драйверы
    • Список драйверов
    • ProAV драйвера
    • AV & Custom Systems
    • JS драйвера
    • Сторонние драйвера и фриланс
    Протоколы и интерфейсы
    • Голосовое управление
    • 1-Wire
    • BACnet IP
    • Bus77
    • KNX
    • KNX IP BAOS
    • Weinzierl kBerry
    • Microsoft Exchange
    • Modbus
    • MQTT
    • NFC
    • ODBC
    • Onvif
    • SIP
    • SNMP
    • Wake On Lan
    • Z-Wave
    • ZigBee
    Производители
    • AMX
    • AVCiT
    • Beckhoff ADS
    • Biamp Tesira
    • Bluesound
    • Casambi
    • BSS Harman
    • Clipsal
    • ControlArt 7Port
    • Crestron
    • DigiBird
    • Domintell
    • Duotecno
    • EIDE
    • EPSNET
    • Global Cache
    • HDL Buspro
    • Helvar
    • IEAST
    • INELS BUS
    • INELS Wireless
    • Intesis
    • Kleger
    • Kramer VIA
    • Kramer 3000
    • Larnitech
    • Legrand Netatmo
    • LG TV
    • Lutron
    • Lutron Homeworks QS
    • MyHome
    • Nest
    • Novastar
    • Panasоnic PTZ
    • Philips Dynalite
    • PJLink
    • Satel
    • SamsungTV
    • Sonos
    • Somfy
    • SpinetiX
    • Televic Conference
    • TIS
    • Tion
    • URRI
    • Velbus
    • Velocio
    • Vinteo
    • WyreStorm
    • WiiM
    • Xicato
    • Yamaha
    • ZONT
    • Z-Wave.me
    Протестированное оборудование
    • Панель HDL S57
    • Панель HDL S10
    • SIP-домофон
    • Akuvox
    • Arlight
    • Divus
    • QBic TD-1050 PRO
    • QBic TD-1060 Slim
    • QBic TD-1070
    • Sigur
    • Uni-Ubi
    • Velocio
  • Оборудование iRidi

    Серверы
    • HS Сервер
    • ProAV Control Processor Basic
    • ProAV Control Processor Advanced
    • Спецификация контроллеров UMC
    • Настройка контроллера UMC C2
    • Настройка контроллера UMC C3
    • Настройка контроллера HDL IntelliCenter 2 (UMC C4)
    Модули расширения
    • I-PX-RS1
    • I-PX-RS4
    • I-PX-IR3
    KNX
    • KNX Home Server
    • KNX IP Interface
    Панели управления
    • iRidium Panel 7
    • Touch Panel P3
    • Touch Panel P6
    • Touch Panel P8
    • Touch Panel P10
    • Tabletop Touch Panel 10
    • AV Remote Control
    ОБОРУДОВАНИЕ BUS77
    • Каталог Bus77 Pro
    • Каталог Bus77 Lite
    • Differences
iRidium mobile web-site
Содержание
    Инструменты‌
    • Сведения о странице
    • Постоянная ссылка
    • Версия для печати
    • Спецстраницы
    • Связанные правки
    • Ссылки сюда
    Login / Create Account
    Материал из for iRidium developers
    Перейти к: навигация, поиск
    Эта страница является переводом страницы Native Animation API. Перевод выполнен на 99%.

    Other languages:
    English • ‎русский

    Содержание

    • 1 iRidium API. Animation
    • 2 Description
    • 3 Methods
      • 3.1 IR.AddAnimation()
      • 3.2 IR.RemoveAnimation()
      • 3.3 IR.StartAllAnimations()
      • 3.4 IR.StopAllAnimations()
      • 3.5 .Start()
      • 3.6 .Stop()
      • 3.7 .AddItem()
      • 3.8 .RemoveItem()
      • 3.9 .AddParameter()
      • 3.10 .GetParameter()
      • 3.11 .GetParametersCount()
      • 3.12 .RemoveParameter()
    • 4 Type of Animation
    • 5 Parameters of Animation
      • 5.1 IR.ANIMATION_MOVE_HORIZONTAL
      • 5.2 IR.ANIMATION_MOVE_VERTICAL
      • 5.3 IR.ANIMATION_MOVE
      • 5.4 IR.ANIMATION_SHIFT_HORIZONTAL
      • 5.5 IR.ANIMATION_SHIFT_VERTICAL
      • 5.6 IR.ANIMATION_SHIFT
      • 5.7 IR.ANIMATION_SIZE_HORIZONTAL
      • 5.8 IR.ANIMATION_SIZE_VERTICAL
      • 5.9 IR.ANIMATION_SIZE
      • 5.10 IR.ANIMATION_SCALE_HORIZONTAL
      • 5.11 IR.ANIMATION_SCALE_VERTICAL
      • 5.12 IR.ANIMATION_SCALE
      • 5.13 IR.ANIMATION_ROTATE
      • 5.14 IR.ANIMATION_OPACITY
      • 5.15 IR.ANIMATION_VALUE
    • 6 Type of Tweener

    iRidium API. Animation

    Native methods to create animation of objects in iRidium Studio.

    documentation was updated on 15.12.2020

    Example: Animation

    Description

    New native animation methods allow to create exactly the same animation as with the help of JS solutions. But projects where native methods are used demand fewer resources of a control panel.


    Methods

    Methods to create, edit and delete animation

    IR.AddAnimation()

    Creation of animation

    Syntax:

    IR.AddAnimation( 
    [ in_oAnimation1, in_oAnimation2, … , in_oAnimationN ]
    [ in_rItem1, in_rItem2, … , in_rItemN ]
    in_nDuration,
    in_nDelay,
    in_bRepeat,
    in_bAutostart,
    in_rStartCallBack,
    in_rEndCallBack,
    in_oContext
    );


    На входе Значение Описание
    [ in_oAnimation1, in_oAnimation2, … , in_oAnimationN ] Type: IR.ANIMATION_MOVE_HORIZONTAL,
    Tween: IR.LINEAR,
    Duration : 1000,
    From : 421,
    To: 300,
    Return: true,
    Repeat: true
    type: Object

    Массив анимаций, либо единичный объект в виде JSON объекта, вида:
    Type: тип анимации из списка,
    Tween: тип твинера из списка (дополнительный),
    Delay: задержка запуска анимации (дополнительный),
    Duration: длительность анимации (дополнительный),
    Repeat: повторяемость анимации (дополнительный),
    Return: переворот анимации в обратную сторону после конца (дополнительный),
    Parameter1 : Value1,
    …
    ParameterN : ValueN

    [ in_rItem1, in_rItem2, … , in_rItemN ]

    ["UI.Page 2.Item 21"],
    IR.GetPage("Page 2").GetItem("Item 1").

    type: Object
    Массив элементов, либо единичный элемент, в виде ссылки на графический элемент.
    in_nDuration 1000 type: Number
    Длительность анимации (массива анимаций) (мс).
    in_nDelay 0 type: Number
    Задержка при старте анимации (массива анимаций) (мс).
    in_bRepeat false type: Boolean
    Зацикливание анимации (массива анимаций).
    in_bAutostart false type: Boolean
    Флаг автоматического старта анимации при создании.
    in_rStartCallBack function onStart() {
    IR.Log(this.OnStart);
    }
    type: Object
    Колбек начала - активирует функцию при старте анимации.
    in_rEndCallBack function onEnd() {
    IR.Log(this.OnEnd);
    }
    type: Object
    Колбек окончания - активирует функцию по окончанию анимации.
    in_oContext { OnStart : "Animation started", OnEnd : "Animation ended" ) type: Object
    Вызываемый контекст колбеков - функция (this), которую можно вызвать по колбеку начала или окончания анимации.
    На выходе
    in_oAnimation animation type: Object
    Объект анимации.

    Parameters of animation depend on the type of animation. You can see a full list of parameters here.


    X and Y coordinates of an item are described in the General folder and on the dynamic panel of iRidium Studio. The start of coordinates is located in the bottom left corner.


    Example

    //example 1: (horizontal movement of an item from X = 421 coordinate to X = 300 coordinate and back 
    // within 1 second):
     
    var animation; 
    //create an object of animation
      animation = IR.AddAnimation({
             Type: IR.ANIMATION_MOVE_HORIZONTAL, // type of animation: horizontal movement
             Tween: IR.LINEAR, // linear function
             Duration : 1000, //duration of animation: 1 sec.
             From : 421, // starting point: X=421
             To: 300, // end point Х = 300
             Return: true, // repetition of animation in the reverse order after the end
             Repeat: false // do not loop animation
          },
          IR.GetPage("Page 2").GetItem("Item 1"), // assign animation to an item
          1000, // duration of animation (array of animations)
          0, // delay of animation = 0 (an array of animations)
          false, // animation (an array of animations) is not looped
          false, // animation does not start with the app launch
    )
     
    //example 2: (horizontal movement of an item from X = 421 coordinate to X = 300 coordinate and back 
    // within 1 second calling functions of animation start and animation end):
     
    //create an object of animation:
    var animation = IR.AddAnimation({
          Type: IR.ANIMATION_MOVE_HORIZONTAL, // type of animation: horizontal movement
          Tween: IR.LINEAR,  // linear function
          Duration : 1000, //duration of animation 1 sec.
          From : 421, // starting point X=421
          To: 300, // end point Х = 300
          Return: true, // repetition of animation in the reverse order after the end
          Repeat: false // do not loop animation
       },
       IR.GetPage("Page 2").GetItem("Item 1"), // assign animation to an item
       1000, // duration of animation (array of animations)
       0, // delay of animation = 0 (an array of animations)
       false, // animation (an array of animations) is not looped
       false, // animation does not start with the app launch
       function() { // activation of a function by the start of animation (start callback)
          IR.Log(this.OnStart);   
       },
       function() { // activation of a function by the end of animation (end callback)
          IR.Log(this.OnEnd);   
       },
       { OnStart : "Animation started", OnEnd : "Animation ended" } // description of functions (a context of callbacks that is called)
    )


    IR.RemoveAnimation()

    Deletion of animation

    Syntax:

    IR.RemoveAnimation(in_oAnimation);
    
    On input Value Description
    in_oAnimation animation type: Object
    Animation object.


    Example

    animation = IR.AddAnimation({
             Type: IR.ANIMATION_SIZE_HORIZONTAL,
             Tween: IR.TWEEN_SINE_IN,
             Duration : 1000,
             From: 96,
             To: 189,
             Return: true,
             Repeat: true
          },
          ["UI.Page 2.Item 21"],
          1000,
          0,
          true,
          false,
        )
     
    IR.RemoveAnimation(animation)



    IR.StartAllAnimations()

    Start of all animations.
    Syntax:

    IR.StartAllAnimations();
    
    On input Value Description
    -


    Sample

    function doStartAll() 
    {
        IR.StartAllAnimations();
    }


    IR.StopAllAnimations()

    Stop of all animations.
    Syntax:

    IR.StopAllAnimations();
    
    On input Value Description
    -


    Example

    function doStopAll() {
        IR.StopAllAnimations();
     }


    .Start()

    Start of animation.

    Syntax:

    in_oAnimation.Start();
    
    On input Value Description
    in_oAnimation animation type: Object
    Animation object.

    Example

    function doStart() {
       animation.Start();
    }


    .Stop()

    Stop of animation

    Syntax:

    in_oAnimation.Stop();
    
    On input Value Description
    in_oAnimation animation type: Object
    Animation object.

    Example

    function doStop() {
       animation.Stop();
    }


    .AddItem()

    Adding a graphic item to animation

    Syntax:

    in_oAnimation.AddItem(Item)
    
    On input Value Description
    in_oAnimation animation type: Object
    Animation object.
    Item IR.GetPage("Page 2").GetItem("Item 21") type: Object
    Object of graphic item.

    Example

    function doAddItem() {
       animation.AddItem(IR.GetPage("Page 2").GetItem("Item 21"));   
    }


    .RemoveItem()

    Deleting a graphic item from animation.

    Syntax:

    in_oAnimation.RemoveItem(Item)
    
    On input Value Description
    in_oAnimation animation type: Object
    Animation object.
    Item IR.GetPage("Page 2").GetItem("Item 21") type: Object
    Object of graphic item.

    Example

    function doRemoveItem() {
       animation.RemoveItem(IR.GetPage("Page 2").GetItem("Item 21"));   
    }


    .AddParameter()

    Adding a parameter to animation.

    Syntax:

    in_oAnimation.AddParameter(Parameter)
    
    On input Value Description
    in_oAnimation animation type: Object
    Animation object.
    Parameter Type: IR.ANIMATION_SIZE_HORIZONTAL,
    Tween: IR.TWEEN_SINE_IN,
    Duration : 1000,
    From: 96,
    To: 189,
    Return: true,
    Repeat: true
    type: Object
    Animation parameter.

    Example

    animation.AddParameter({
             Type: IR.ANIMATION_SIZE_HORIZONTAL,
             Tween: IR.TWEEN_SINE_IN,
             Duration : 1000,
             From: 96,
             To: 189,
             Return: true,
             Repeat: true
          })


    .GetParameter()

    Get a parameter by index.

    Syntax:

    in_oAnimation.GetParameter(Index)
    
    In input Value Description
    in_oAnimation animation type: Object
    Animation object.
    Index 0-n type: Number
    The ordinal number of a parameter.
    На выходе
    Parameter Type: IR.ANIMATION_SIZE_HORIZONTAL,
    Tween: IR.TWEEN_SINE_IN,
    Duration : 1000,
    From: 96,
    To: 189,
    Return: true,
    Repeat: true
    type: Object
    Animation parameter.

    Example

    animation.GetParameter(0);


    .GetParametersCount()

    Get the number of parameters.

    Syntax:

    in_oAnimation.GetParametersCount()
    
    On input 'Value Description
    in_oAnimation animation type: Object
    Animatio object.
    On output
    num 4 type: Number
    The number of parameters.

    Example

    animation.GetParametersCount() //4


    .RemoveParameter()

    Delete a parameter by index.

    Syntax:

    in_oAnimation.RemoveParameter(Index)
    
    On input Value Description
    in_oAnimation animation type: Object
    Animation object.
    Index 0-n type: Number
    The ordinal number of a parameter.

    Example

    animation.RemoveParameter(0)


    Type of Animation

    A type of animation is a se direction of movement, rotation, hiding and other animation capabilities of items.

    • IR.ANIMATION_MOVE_HORIZONTAL - horizontal movement of an item from a point to a point;
    • IR.ANIMATION_MOVE_VERTICAL - vertical movement of an item from a point to a point;
    • IR.ANIMATION_MOVE - diagonal movement of an item from a point to a point;
    • IR.ANIMATION_SHIFT_HORIZONTAL - a horizontal item shift at a definite number of pixels;
    • IR.ANIMATION_SHIFT_VERTICAL - a vertical item shift at a definite number of pixels;
    • IR.ANIMATION_SHIFT - a diagonal item shift at a definite number of pixels;
    • IR.ANIMATION_SIZE_HORIZONTAL - change of horizontal sizes of an item;
    • IR.ANIMATION_SIZE_VERTICAL - change of vertical sizes of an item;
    • IR.ANIMATION_SIZE - change of diagonal sizes of an item;
    • IR.ANIMATION_SCALE_HORIZONTAL - horizontal scaling of a item;
    • IR.ANIMATION_SCALE_VERTICAL - vertical scaling of a item;
    • IR.ANIMATION_SCALE - diagonal scaling of a item;
    • IR.ANIMATION_ROTATE - item rotation;
    • IR.ANIMATION_OPACITY - show/hide item;
    • IR.ANIMATION_VALUE - change of the Value of an item.


    Parameters of Animation

    Each type of animation has its unique parameters:

    IR.ANIMATION_MOVE_HORIZONTAL

    • From - the initial point of movement along the X axis (default = the current position);
    • To - the end point of movement along the X axis (default = the current position).

    IR.ANIMATION_MOVE_VERTICAL

    • From - the initial point of movement along the Y axis (default = the current position);
    • To - the end point of movement along the Y axis (default = the current position).

    IR.ANIMATION_MOVE

    • From - the initial point of movement along the X and Y axes (default = the current position);
    • To - the end point of movement along the X and Y axes (default = the current position);
    • FromX - the X coordinate of the initial point of movement (default = the current position);
    • FromY - the Y coordinate of the initial point of movement (default = the current position);
    • ToX - the X coordinate of the end point of movement (default = the current position);
    • ToY - the Y coordinate of the end point of movement (default = the current position)

    If there are FromX, FromY, ToX, ToY parameters, they are used differently from From and To.

    IR.ANIMATION_SHIFT_HORIZONTAL

    • From - the initial horizontal shift of an item in pixels (0 - the current position, -100 - 100px to the left, 200 - 200px to the right etc.) (default = 0);
    • To - the number of pixels by which in item will be moved horizontally (default = 0).

    IR.ANIMATION_SHIFT_VERTICAL

    • From - the initial vertical shift of an item in pixels (0 - the current position, -100 - 100px to the left, 200 - 200px to the right etc.) (default = 0);
    • To - the number of pixels by which in item will be moved vertically (default = 0).

    IR.ANIMATION_SHIFT

    • From - the initial diagonal shift of an item in pixels (0 - the current position, -100 - 100px to the left, 200 - 200px to the right etc.) (default = 0);
    • To - the number of pixels by which an item will be moved diagonally (default = 0);
    • FromHorizontal - the initial horizontal shift of an item in pixels (0 - the current position, -100 - 100px to the left, 200 - 200px to the right etc.) (default = 0);
    • FromVertical - the initial vertical shift of an item in pixels (0 - the current position, -100 - 100px to the left, 200 - 200px to the right etc.) (default = 0);
    • ToHorizontal - the number of pixels by which an item will be moved horizontally (default = 0);
    • ToVertical - the number of pixels by which an item will be moved vertically (default = 0);

    If there are FromHorizontal, FromVertical, ToHorizontal, ToVertical parameters, they are used differently from From and To accordingly.

    IR.ANIMATION_SIZE_HORIZONTAL

    • From - the initial width of an item (default = the current width);
    • To - the end width of an item (default = the current width).

    IR.ANIMATION_SIZE_VERTICAL

    • From - the initial height of an item (default = the current height);
    • To - the end height of an item (default = the current height).

    IR.ANIMATION_SIZE

    • From - the initial width and height of an item (default = current values);
    • To - the end width and height of an item (default = current values);
    • FromWidth - the initial width of an item (default = the current width);
    • FromHeight - the initial height of an item (default = the current width);
    • ToWidth - the end width of an item (default = the current width);
    • ToHeight - the end height of an item (default = the current height);

    If there are FromWidth, FromHeight, ToWidth, ToHeight parameters, they are used differently from From and To accordingly.

    IR.ANIMATION_SCALE_HORIZONTAL

    • From - the initial width quotient (if there is none, use 1);
    • To - the end width quotient (if there is none, use 1);

    IR.ANIMATION_SCALE_VERTICAL

    • From - the initial height quotient (if there is none, use 1);
    • To - the end height quotient (if there is none, use 1).

    IR.ANIMATION_SCALE

    • From - the initial size quotient (if there is none, use 1);
    • To - the end size quotient (if there is none, use 1);
    • FromHorizontal - the initial width quotient (if there is none, use 1);
    • FromVertical - the initial height quotient (if there is none, use 1);
    • ToHorizontal - the end width quotient (if there is none, use 1);
    • ToVertical - the end height quotient (if there is none, use 1).

    If there are FromHorizontal, FromVertical, ToHorizontal, ToVertical parameters, they are used differently from From and To accordingly.

    IR.ANIMATION_ROTATE

    • From - the initial rotation angle (if there is none, then rotation from the current angle position);
    • To - the end rotation angle

    IR.ANIMATION_OPACITY

    • From - the initial transparency of an item (default = the current transparency);
    • To - the end transparency of an item (default = the current transparency).

    IR.ANIMATION_VALUE

    • From - the initial value (default = the current value);
    • To - the end value (default = the current value).

    Type of Tweener

    Tweener is a type of animation calculation. A formula defines how an intermediate value on a selected interval will be calculated. Each formula has its number that must be sent to a function when animation is created.

    TypeOfTween.png

    Names and numbers of formulae

    • IR.TWEEN_LINEAR = 0;
    • IR.TWEEN_SINE_IN = 1;
    • IR.TWEEN_SINE_OUT = 2;
    • IR.TWEEN_SINE_IN_OUT = 3;
    • IR.TWEEN_QUINT_IN = 4;
    • IR.TWEEN_QUINT_OUT = 5;
    • IR.TWEEN_QUINT_IN_OUT = 6;
    • IR.TWEEN_QUART_IN = 7;
    • IR.TWEEN_QUART_OUT = 8;
    • IR.TWEEN_QUART_IN_OUT = 9;
    • IR.TWEEN_QUAD_IN = 10;
    • IR.TWEEN_QUAD_OUT = 11;
    • IR.TWEEN_QUAD_IN_OUT = 12;
    • IR.TWEEN_EXPO_IN = 13;
    • IR.TWEEN_EXPO_OUT = 14;
    • IR.TWEEN_EXPO_IN_OUT = 15;
    • IR.TWEEN_ELASTIC_IN = 16;
    • IR.TWEEN_ELASTIC_OUT = 17;
    • IR.TWEEN_ELASTIC_IN_OUT = 18;
    • IR.TWEEN_CUBIC_IN = 19;
    • IR.TWEEN_CUBIC_OUT = 20;
    • IR.TWEEN_CUBIC_IN_OUT = 21;
    • IR.TWEEN_CIRC_IN = 22;
    • IR.TWEEN_CIRC_OUT = 23;
    • IR.TWEEN_CIRC_IN_OUT = 24;
    • IR.TWEEN_BOUNCE_IN = 25;
    • IR.TWEEN_BOUNCE_OUT = 26;
    • IR.TWEEN_BOUNCE_IN_OUT = 27;
    • IR.TWEEN_BACK_IN = 28;
    • IR.TWEEN_BACK_OUT = 29;
    • IR.TWEEN_BACK_IN_OUT = 30.
    Источник — «https://dev.iridi.com/index.php?title=Native_Animation_API/en&oldid=103836»
    About us
    Company
    Team
    History
    Philosophy
    Rewards
    Partnership
    Our partner
    Partnership Programs
    Apply for partnership
    products
    iRidium pro
    iRidium lite
    iRidium gate
    iRidium server
    Loads
    iRidium pro
    iRidium lite
    Other version
    Marketing materials
    Support
    On-line courses/Video
    Recommended equipment
    Other version
    iRidium pro
    Documentation
    FAQ
    Forum
    iRidium lite
    Documentation
    Forum
    Projects
    Standart projects
    Smart buildings
    Smart house
    Special solution
    Find a dealer
    News
    Youtube
    Twitter
    VK
    Logo
    contact@iridi.com
    +7 (499) 322-73-29

    Privacy policy