So, this is probably a super simple question… let me start by saying that I am not a programmer. I have intermediate knowledge with C# and have worked in “another popular engine” for years but Cocos is brand new to me. Most of my time working in cocos has been devoted to shader work. That being said,
I’m trying to determine if I can do something a certain way, and, if so, can someone provide a basic example of what the code would look like?
So, I am trying to create a card flip effect. Currently, my client engineer has 5 cards being dealt and each card sprite pulls from a random card image on an atlas. My client engineer is also super busy building the rest of the game and doesn’t have time to look into my question right now. I would like to put the image of the card’s back as the default sprite frame. Then, during the timeline animation clip, at the point where the card should be flipping over, is it possible to insert a frame event where the sprite image should change, and trigger it to pull random card sprite from atlas in code?
I know I can change the sprite frame image in the timeline, but it needs to pull from an array. Can we use the frame event feature in the timeline editor to do this? Or am I misunderstanding what the “insert frame event” is/does?
Edit: In case it is misleading… I know how to make the card physically look like it is flipping over. I’ve already accomplished that. Normally, I’d just change the sprite frame image right as the card is “flipping” to make it look like it really flipped over… but, as I said before, I can’t just change sprite image from timeline because the image that is used needs to be random. I guess what I’m asking is, can the inserted frame event be used a signal to trigger that change in code?