C# 클래스 SparrowSharp.Utils.Juggler

The Juggler takes objects that implement IAnimatable (e.g. 'MovieClip's) and executes them. A juggler is a simple object. It does no more than saving a list of objects implementing 'Animatable' and advancing their time if it is told to do so (by calling its own 'AdvanceTime' method). Furthermore, an object can request to be removed from the juggler by dispatching an 'RemoveFromJuggler' event. There is a default juggler that you can access from anywhere with the following code: Juggler juggler = SparrowSharpApp.DefaultJuggler; You can, however, create juggler objects yourself, too. That way, you can group your game into logical components that handle their animations independently. A cool feature of the juggler is to delay method calls. Say you want to remove an object from its parent 2 seconds from now. Call: juggler.DelayInvocationAtTarget(object.RemoveFromParent, 2.0f); This line of code will execute the following method 2 seconds in the future: object.RemoveFromParent(); Alternatively, you can use the block-based verson of the method: juggler.DelayInvocationByTime(delegate{ object.RemoveFromParent(); }, 2.0f);
상속: IAnimatable
파일 보기 프로젝트 열기: fmotagarcia/sparrow-sharp 1 사용 예제들

공개 메소드들

메소드 설명
Add ( IAnimatable animatable ) : void

Adds an object to the juggler.

AdvanceTime ( float seconds ) : void
Contains ( IAnimatable animatable ) : bool

Determines if an object has been added to the juggler.

DelayInvocationOf ( IAnimatable animatable, float time ) : object

Delays the execution of a certain method. Returns a proxy object on which to call the method instead. Execution will be delayed until 'time' has passed.

Remove ( IAnimatable animatable ) : void

Removes an object from the juggler.

RemoveAll ( ) : void

Removes all objects at once.

메소드 상세

Add() 공개 메소드

Adds an object to the juggler.
public Add ( IAnimatable animatable ) : void
animatable IAnimatable
리턴 void

AdvanceTime() 공개 메소드

public AdvanceTime ( float seconds ) : void
seconds float
리턴 void

Contains() 공개 메소드

Determines if an object has been added to the juggler.
public Contains ( IAnimatable animatable ) : bool
animatable IAnimatable
리턴 bool

DelayInvocationOf() 공개 메소드

Delays the execution of a certain method. Returns a proxy object on which to call the method instead. Execution will be delayed until 'time' has passed.
public DelayInvocationOf ( IAnimatable animatable, float time ) : object
animatable IAnimatable
time float
리턴 object

Remove() 공개 메소드

Removes an object from the juggler.
public Remove ( IAnimatable animatable ) : void
animatable IAnimatable
리턴 void

RemoveAll() 공개 메소드

Removes all objects at once.
public RemoveAll ( ) : void
리턴 void