Skip to content

3.0 AS Library Updates

Chenguang Liu edited this page Jul 7, 2014 · 6 revisions

DragonBones 3.0 AS Library is released.

https://github.com/DragonBones/DragonBonesAS/releases/tag/V3.0

DragonBones 3.0 beta AS Library is totally compatible with 2.4.1 DesignPanel.You can still work with 2.4.1 designpanel and leverage 3.0 Library in you game. (3.0 beta DesignPanel will coming soon)

3.0 beta AS Library New Feature:

  1. Animation support gotoAndStop
  2. Animation support play backward
  3. Factory and DataParser support delay parse animation data in parse data process.
  4. Improve Performance by Cache Animation and adjust animation Sampling Rate.
  5. Improve performance by Optimize handling still bones.

Code Structure refine

  1. Remove DisplayBridge. Use Slot to replace it. Each rendering engine need to extend Slot to integrated with DragonBones.

API refine:

  1. bone.fixRotation, replaced by bone.inheritRotation
  2. bone.scaleMode, replaced by bone.inheritScale
  3. slot.fixRotation,replaced by slot.inheritRotation
  4. slot.scaleMode,replaced by slot.inheritScale;
  5. animationState.currentTime,replaced by animationState.setCurrentTime
  6. armature.invalidUpdate(boneName:String = null)
    It support updae a bone inside of the whole armature.
  7. animation.gotoAndPlay
    return imported AnimationState Object.
  8. factory.parseData(bytes:ByteArray, dataName:String = null, ifSkipAnimationData:Boolean = false, outputAnimationDictionary:Dictionary = null):SkeletonData
    DataParser.parseData(rawData:Object, ifSkipAnimationData:Boolean = false, outputAnimationDictionary:Dictionary = null):SkeletonData
    Add new parameter ifSkipAnimationData, set it to true to skip parse animation data.
    Add new parameter outputAnimationDictionary, animationData will be fulfilled into it if it is an not null.

API Added

  1. armature.cacheFrameRate
    When armature.cacheFrameRate > 0, cache animation based on the frame rate. It will increase rendering performance as well as the memory consumption and also lose some animation feature ( such as bone.offset can not be used. The timescale of bone's timeline must be 1/2^n (1, 0.5, 0.25)

  2. bone.invalidUpdate Force update bone in next frame even the bone is not moving

  3. animation.gotoAndStop Control the animation to stop with a specified time. If related animationState haven't been created, then create a new animationState.
    @param animationName : The name of the animationState.
    @param time
    @param normalizedTime
    @param fadeInTime : A fade time to apply (>= 0), -1 means use xml data's fadeInTime.
    @param duration : The duration of that AnimationData
    @param layer : The layer of the animation.
    @param group : The group of the animation.
    @param fadeOutMode Fade out mode (none, sameLayer, sameGroup, sameLayerAndGroup, all).
    @return AnimationState.

  4. factory.addAnimationToArmature(animationRawData:Object, armature:Armature, frameRate:uint):void
    Add a new animation to armature.
    @param animationRawData (XML, JSON).
    @param target armature.
    @param frame rate.

Unrecommended API -> Recommended API

  1. bone.node -> bone.offset
  2. animation.movementList -> animation.animationList
  3. animation.movementID -> animation.lastAnimationName
  4. animationEvent.MOVEMENT_CHANGE -> animationEvent.FADE_IN or animationEvent.START
  5. animationEvent.movementID -> animation.animationName
  6. FrameEvent.MOVEMENT_FRAME_EVENT -> FrameEvent.ANIMATION_FRAME_EVENT
  7. bone.childArmature -> slot.childArmature
  8. bone.display -> slot.display
Clone this wiki locally