Added a pause step before the drop into the hand.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3494 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -441,19 +441,21 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Flies a set of cards from the ether into the hand. Clears any selected
|
* Flies a set of cards from the ether into the hand. Clears any selected
|
||||||
* cards. If the drop duration is nonzero, the cards will first fly to
|
* cards. The cards will first fly to the selected card offset, pause for
|
||||||
* the selected card offset and then drop slowly into the hand.
|
* the specified duration, and then drop into the hand.
|
||||||
*
|
*
|
||||||
* @param cards the cards to add to the hand
|
* @param cards the cards to add to the hand
|
||||||
* @param src the point to fly the cards from
|
* @param src the point to fly the cards from
|
||||||
* @param flightDuration the duration of the cards' flight
|
* @param flightDuration the duration of the cards' flight
|
||||||
|
* @param pauseDuration the duration of the pause before dropping into the
|
||||||
|
* hand
|
||||||
* @param dropDuration the duration of the cards' drop into the
|
* @param dropDuration the duration of the cards' drop into the
|
||||||
* hand
|
* hand
|
||||||
* @param fadePortion the amount of time to spend fading in
|
* @param fadePortion the amount of time to spend fading in
|
||||||
* as a proportion of the flight duration
|
* as a proportion of the flight duration
|
||||||
*/
|
*/
|
||||||
public void flyIntoHand (Card[] cards, Point src, long flightDuration,
|
public void flyIntoHand (Card[] cards, Point src, long flightDuration,
|
||||||
long dropDuration, float fadePortion)
|
long pauseDuration, long dropDuration, float fadePortion)
|
||||||
{
|
{
|
||||||
// first create the sprites and add them to the list
|
// first create the sprites and add them to the list
|
||||||
CardSprite[] sprites = new CardSprite[cards.length];
|
CardSprite[] sprites = new CardSprite[cards.length];
|
||||||
@@ -474,22 +476,15 @@ public abstract class CardPanel extends VirtualMediaPanel
|
|||||||
sprites[i].addSpriteObserver(_handSpriteObserver);
|
sprites[i].addSpriteObserver(_handSpriteObserver);
|
||||||
addSprite(sprites[i]);
|
addSprite(sprites[i]);
|
||||||
|
|
||||||
// if dropping, create a path sequence combining flight and drop
|
// create a path sequence containing flight, pause, and drop
|
||||||
Path path;
|
ArrayList paths = new ArrayList();
|
||||||
long pathDuration;
|
Point hp2 = new Point(getHandX(size, idx), _handLocation.y),
|
||||||
Point hp = new Point(getHandX(size, idx), _handLocation.y);
|
hp1 = new Point(hp2.x, hp2.y - _selectedCardOffset);
|
||||||
if (dropDuration > 0) {
|
paths.add(new LinePath(hp1, flightDuration));
|
||||||
LinePath flight = new LinePath(new Point(hp.x, hp.y -
|
paths.add(new LinePath(hp1, pauseDuration));
|
||||||
_selectedCardOffset), flightDuration),
|
paths.add(new LinePath(hp2, dropDuration));
|
||||||
drop = new LinePath(hp, dropDuration);
|
sprites[i].moveAndFadeIn(new PathSequence(paths), flightDuration +
|
||||||
path = new PathSequence(flight, drop);
|
pauseDuration + dropDuration, fadePortion);
|
||||||
pathDuration = flightDuration + dropDuration;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
path = new LinePath(hp, flightDuration);
|
|
||||||
pathDuration = flightDuration;
|
|
||||||
}
|
|
||||||
sprites[i].moveAndFadeIn(path, pathDuration, fadePortion);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user