Показать сообщение отдельно
Старый 10.09.2012, 11:51
Dmitron вне форума Посмотреть профиль Отправить личное сообщение для Dmitron Найти все сообщения от Dmitron
  № 1  
Ответить с цитированием
Dmitron

Регистрация: Sep 2012
Сообщений: 10
По умолчанию Движок Flixel - функция addAnimation()

Доброго дня!
Проясните пожалуйста работу функции. имеем код:
Код:
[Embed(source="alien.png")] private var ImgAlien:Class; //The graphic of the squid monster
loadGraphic(ImgAlien,true);     //Load this animated graphic file
addAnimation("Default",[0,1,0,2],6+FlxG.random()*4);
//Time to create a simple animation!  alien.png has 3 frames of animation in it.
//We want to play them in the order 1, 2, 3, 1 (but of course this stuff is 0-index).
//To avoid a weird, annoying appearance the framerate is randomized a little bit
// to a value between 6 and 10 (6+4) frames per second.
play("Default");
код использует картинку 46х16 пикселей

и выделяет в ней 3 фрэйма

Формат png не поддерживает анимацию.

Как движок разделяет кадры?


Последний раз редактировалось Dmitron; 11.09.2012 в 12:55.