Android 卡牌游戏动画
我写了一个小纸牌游戏。我现在想要制作一些动画,例如从牌组中取出一张牌并将其移至“打开牌池”。我可以通过使用翻译(下面的代码)来实现这一点。但问题是,每当一张新卡被取出并移动时,“开放卡池”看起来是空的。我怎样才能显示“开放卡池中的最后一张开放卡:?在动画制作时是否有一个标志或其他东西可以将图像保留在其原始位置?”
<translate
android:fromXDelta="-100%"
android:toXDelta="0%"
android:fromYDelta="0%"
android:toYDelta="0%"
android:duration="1000"
android:zAdjustment="top" />
I have written a small card game. I now want to animate few things like taking a card from a deck and moving it to "open cards pool". I could achieve this by using translate (below code). But the problem is whenever a new card is taken and moved, the "open cards pool" looks empty. How can i possibly show the last open card in "open cards pool:? Is there a flag or something to retain the image at its original place while it is being animated?
<translate
android:fromXDelta="-100%"
android:toXDelta="0%"
android:fromYDelta="0%"
android:toYDelta="0%"
android:duration="1000"
android:zAdjustment="top" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用两个图像。当您开始从打开的卡片池中移动图像时,立即在同一位置显示下一张卡片。
如果卡片在视觉上看起来相同(仅显示卡片的背面),那么您可以通过将移动卡片添加到场景顶部并移动它而原始卡片从不移动来伪造它。
You'll have to use two images. When you start moving an image from the open cards pool, immediately display the next card in the same position.
If the cards look visually the same (only display the backs of the cards), then you can fake it by adding the moving card to the top of the scene and moving it while the original card never moves.