Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
-
Nero
- Veteran
- Posts: 242
- Joined: Tue Aug 09, 2016 2:59 pm
-
Contact:
#1
Post
by Nero » Mon Mar 30, 2020 8:50 pm
I'm learning how to do simple animations. I would like to know how to make simple animation happens when you append variable to a list.
So my idea would be like this. Player is holding few cards in his hand, when you do card draw by that i mean (append card to his hand(list)) simple animation should happen of drawn card gliding from the right corner of the screen to the middle of the screen.
Can anyone help me with example how do I make animation when you add items to a list?
That is the example but it is not animated.
Code: Select all
screen cards():
hbox:
xalign 0.5 yalign 0.9
for c in deck:
add c.picture
init python:
class Card(object):
name = "Something"
picture = "somepic"
deck = [Card(),Card()]
label start:
"..."
show screen cards
"Now lets append card to a deck so it appears like card is gliding from the right corner to the middle of the screen..."
$ deck.append(Card())
"But how to do that?"
Last edited by
Nero on Tue Mar 31, 2020 9:13 am, edited 1 time in total.
-
Per K Grok
- Miko-Class Veteran
- Posts: 882
- Joined: Fri May 18, 2018 1:02 am
- Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
- itch: per-k-grok
- Location: Sverige
-
Contact:
#2
Post
by Per K Grok » Tue Mar 31, 2020 1:21 am
Nero wrote: ↑Mon Mar 30, 2020 8:50 pm
I'm learning how to do simple animations. I would like to know how to make simple animation happens when you append variable to a list.
So my idea would be like this. Player is holding few cards in his hand, when you do card draw by that i mean (append card to his hand(list)) simple animation should happen of drawn card gliding from the right corner of the screen to the middle of the screen.
Can anyone help me with example how do I make animation when you add items to a list?
That is the example but it is not animated.
Code: Select all
screen cards():
hbox:
xalign 0.5 yalign 0.9
for c in deck:
add c.picture
init python:
class Card(object):
name = "Something"
picture = "somepic"
deck = [Card(),Card()]
label start:
"..."
show screen cards
"Now lets append card to a deck so it appears like card is gliding from the right corner to the middle of the screen..."
$ deck.append(Card())
"But how to do that?"
You could slide an image of the card using ATL. In the exampel below you have an image such as "cardback.png" that will slide from the top right corner to the middle and then disappear just as the new card appears in the hand.
Code: Select all
show screen cards
"Now lets append card to a deck so it appears like card is gliding from the right corner to the middle of the screen..."
show cardback:
align (1, 0)
linear 2.0 align (0.5,0.5)
pause 2.0
hide cardback
$ deck.append(Card())
"But how to do that?"
-
Nero
- Veteran
- Posts: 242
- Joined: Tue Aug 09, 2016 2:59 pm
-
Contact:
#3
Post
by Nero » Tue Mar 31, 2020 9:13 am
Ahhh I see how this works. That's it thank you!
Users browsing this forum: Bing [Bot], _ticlock_