本文整理汇总了C#中com.getTimeline方法的典型用法代码示例。如果您正苦于以下问题:C# com.getTimeline方法的具体用法?C# com.getTimeline怎么用?C# com.getTimeline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com
的用法示例。
在下文中一共展示了com.getTimeline方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: equals
/// <param name="object">to compare with</param>
/// <returns>true if both objects have the same id.</returns>
public virtual bool equals(com.brashmonkey.spriter.objects.SpriterAbstractObject
@object)
{
if (@object == null)
{
return false;
}
return this.timeline == @object.getTimeline();
}
示例2: buildAnimation
//import com.brashmonkey.spriter.converters.SpriterObjectConverter;
//import com.discobeard.spriter.dom.AnimationObject;
//final private SpriterObjectConverter objectConverter = new SpriterObjectConverter();
public virtual com.brashmonkey.spriter.animation.SpriterAnimation buildAnimation(
com.discobeard.spriter.dom.Animation animation)
{
com.discobeard.spriter.dom.MainLine mainline = animation.getMainline();
System.Collections.Generic.IList<com.discobeard.spriter.dom.TimeLine> timeLines =
animation.getTimeline();
System.Collections.Generic.IList<com.discobeard.spriter.dom.Key> keyFrames = mainline
.getKey();
bonesToTween = new System.Collections.Generic.Dictionary<com.brashmonkey.spriter.objects.SpriterBone
, int>();
objectsToTween = new System.Collections.Generic.Dictionary<com.brashmonkey.spriter.objects.SpriterObject
, int>();
com.brashmonkey.spriter.animation.SpriterAnimation spriterAnimation = new com.brashmonkey.spriter.animation.SpriterAnimation
(animation.getId(), animation.getName(), animation.getLength());
for (int k = 0; k < keyFrames.Count; k++)
{
com.discobeard.spriter.dom.Key mainlineKey = keyFrames[k];
System.Collections.Generic.IList<com.brashmonkey.spriter.objects.SpriterObject> tempObjects
= new System.Collections.Generic.List<com.brashmonkey.spriter.objects.SpriterObject
>();
System.Collections.Generic.IList<com.brashmonkey.spriter.objects.SpriterBone> tempBones
= new System.Collections.Generic.List<com.brashmonkey.spriter.objects.SpriterBone
>();
com.brashmonkey.spriter.animation.SpriterKeyFrame frame = new com.brashmonkey.spriter.animation.SpriterKeyFrame
();
frame.setTime(mainlineKey.getTime());
frame.setId(mainlineKey.getId());
foreach (com.discobeard.spriter.dom.BoneRef boneRef in mainlineKey.getBoneRef())
{
com.discobeard.spriter.dom.TimeLine timeline = timeLines[boneRef.getTimeline()];
com.discobeard.spriter.dom.Key timelineKey = timeline.getKey()[boneRef.getKey()];
com.brashmonkey.spriter.objects.SpriterBone bone = boneMerger.merge(boneRef, timelineKey
);
bone.setName(timeline.getName());
if (mainlineKey.getTime() != timelineKey.getTime())
{
bonesToTween.Add(bone, k);
}
else
{
tempBones.Add(bone);
}
}
//}
foreach (com.discobeard.spriter.dom.AnimationObjectRef objectRef in mainlineKey.getObjectRef
())
{
com.discobeard.spriter.dom.TimeLine timeline = timeLines[objectRef.getTimeline()];
com.discobeard.spriter.dom.Key timelineKey = timeline.getKey()[objectRef.getKey()
];
com.brashmonkey.spriter.objects.SpriterObject @object = objectMerger.merge(objectRef
, timelineKey);
@object.setName(timeline.getName());
if (mainlineKey.getTime() != timelineKey.getTime())
{
objectsToTween.Add(@object, k);
}
else
{
tempObjects.Add(@object);
}
}
//}
frame.setObjects(Sharpen.Collections.ToArray(tempObjects, new com.brashmonkey.spriter.objects.SpriterObject
[tempObjects.Count]));
frame.setBones(Sharpen.Collections.ToArray(tempBones, new com.brashmonkey.spriter.objects.SpriterBone
[tempBones.Count]));
spriterAnimation.frames.Add(frame);
}
this.tweenBones(spriterAnimation);
this.tweenObjects(spriterAnimation);
return spriterAnimation;
}
示例3: tweenBone
private void tweenBone(com.brashmonkey.spriter.objects.SpriterBone currentBone, com.brashmonkey.spriter.objects.SpriterBone
nextBone, int i, long startTime, long endTime)
{
currentBone.copyValuesTo(this.tempBones[i]);
this.tempBones[i].setTimeline((nextBone != null) ? currentBone.getTimeline() : -1
);
com.brashmonkey.spriter.objects.SpriterAbstractObject parent = (this.tempBones[i]
.hasParent()) ? this.tempBones[this.tempBones[i].getParentId()] : this.tempParent;
if (nextBone != null)
{
if (parent != this.tempParent)
{
if (!currentBone.getParent().equals(nextBone.getParent()))
{
nextBone = (com.brashmonkey.spriter.objects.SpriterBone)this.getTimelineObject(currentBone
, this.tempBones2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextBone);
nextBone.setAngle(nextBone.getAngle() * this.flippedX * this.flippedY);
}
}
else
{
if (nextBone.hasParent())
{
nextBone = (com.brashmonkey.spriter.objects.SpriterBone)this.getTimelineObject(currentBone
, this.tempBones2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextBone);
nextBone.setAngle(nextBone.getAngle() * this.flippedX * this.flippedY);
}
}
if (this.tempBones[i].tween)
{
this.interpolateAbstractObject(this.tempBones[i], currentBone, nextBone, startTime
, endTime);
}
}
this.moddedBones[currentBone.getId()].modSpriterBone(this.tempBones[i]);
if (this.transitionFixed)
{
this.tempBones[i].copyValuesTo(this.lastFrame.getBones()[i]);
}
else
{
this.tempBones[i].copyValuesTo(this.lastTempFrame.getBones()[i]);
}
if (!this.tempBones[i].hasParent() || !this.moddedBones[currentBone.getId()].isActive
())
{
this.tempBones[i].setX(this.tempBones[i].getX() + this.pivotX);
this.tempBones[i].setY(this.tempBones[i].getY() + this.pivotY);
}
this.translateRelative(this.tempBones[i], parent);
}
示例4: getTimelineObject
protected internal virtual com.brashmonkey.spriter.objects.SpriterAbstractObject getTimelineObject(com.brashmonkey.spriter.objects.SpriterAbstractObject @object,
com.brashmonkey.spriter.objects.SpriterAbstractObject[] objects)
{
for (int i = 0; i < objects.Length; i++)
{
if (objects[i].getTimeline().Equals(@object.getTimeline()))
{
return objects[i];
}
}
return null;
}
示例5: tweenObject
private void tweenObject(com.brashmonkey.spriter.objects.SpriterObject currentObject
, com.brashmonkey.spriter.objects.SpriterObject nextObject, int i, long startTime
, long endTime)
{
com.brashmonkey.spriter.draw.DrawInstruction dI = this.instructions[i];
currentObject.copyValuesTo(this.tempObjects[i]);
com.brashmonkey.spriter.objects.SpriterAbstractObject parent = null;
if (!currentObject.isTransientObject())
{
this.tempObjects[i].setTimeline((nextObject != null) ? currentObject.getTimeline(
) : -1);
parent = (currentObject.hasParent()) ? this.tempBones[currentObject.getParentId()
] : this.tempParent;
if (nextObject != null)
{
if (parent != this.tempParent)
{
if (!currentObject.getParent().equals(nextObject.getParent()))
{
nextObject = (com.brashmonkey.spriter.objects.SpriterObject)this.getTimelineObject
(currentObject, this.tempObjects2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextObject);
nextObject.setAngle(nextObject.getAngle() * this.flippedX * this.flippedY);
}
}
else
{
if (nextObject.hasParent())
{
nextObject = (com.brashmonkey.spriter.objects.SpriterObject)this.getTimelineObject
(currentObject, this.tempObjects2);
com.brashmonkey.spriter.SpriterCalculator.reTranslateRelative(parent, nextObject);
nextObject.setAngle(nextObject.getAngle() * this.flippedX * this.flippedY);
}
}
if (this.tempObjects[i].tween)
{
this.interpolateSpriterObject(this.tempObjects[i], currentObject, nextObject, startTime
, endTime);
}
}
this.moddedObjects[currentObject.getId()].modSpriterObject(this.tempObjects[i]);
if (this.transitionFixed)
{
this.tempObjects[i].copyValuesTo(this.lastFrame.getObjects()[i]);
}
else
{
this.tempObjects[i].copyValuesTo(this.lastTempFrame.getObjects()[i]);
}
}
else
{
parent = this.tempParent;
}
if (!this.tempObjects[i].hasParent())
{
this.tempObjects[i].setX(this.tempObjects[i].getX() + this.pivotX);
this.tempObjects[i].setY(this.tempObjects[i].getY() + this.pivotY);
}
this.translateRelative(this.tempObjects[i], parent);
if (this.moddedObjects[currentObject.getId()].getRef() != null)
{
this.tempObjects[i].setRef(this.moddedObjects[currentObject.getId()].getRef());
}
/*if (this.moddedObjects[currentObject.getId()].getLoader() != null)
{
this.tempObjects[i].setLoader(this.moddedObjects[currentObject.getId()].getLoader
());
}*/
this.tempObjects[i].copyValuesTo(dI);
this.setInstructionRef(dI, this.tempObjects[i], nextObject);
}
示例6: loadTimelines
private static void loadTimelines(List<XmlNode
> timelines, com.discobeard.spriter.dom.Animation animation)
{
for (int i = 0; i < timelines.Count; i++)
{
com.discobeard.spriter.dom.TimeLine timeline = new com.discobeard.spriter.dom.TimeLine
();
timeline.setId(XmlReader.getInt(timelines[i],"id" ));
animation.getTimeline().Add(timeline);
loadTimelineKeys(XmlReader.getChildrenByName(timelines[i],"key"), timeline);
}
}