Skip to content

How to render a running Animate sprite on a RenderTexture? #2431

Answered by rh101
hasikill asked this question in Q&A
Discussion options

You must be logged in to vote

How another library handles it has nothing to do with Axmol, so it's not something you can easily port across.

Now, if you want to get this working, then once again, you need to gain a better understanding of how the node system works in Axmol.

For this specific case, and assuming you don't want to render the g_entity in the scene, then this is what you do:

Create the entity and add the animations to it in MainScene::init():

std::vector<RefPtr<game::Animation>> animations;
animations.push_back(game::Animation::Create("res/base.png", 10, 96, 64));
animations.push_back(game::Animation::Create("res/bowlhair.png", 10, 96, 64));
animations.push_back(game::Animation::Create("res/tools.png", 10,…

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@hasikill
Comment options

@rh101
Comment options

rh101 Mar 6, 2025
Collaborator

@hasikill
Comment options

@rh101
Comment options

rh101 Mar 6, 2025
Collaborator

Answer selected by hasikill
@hasikill
Comment options

@rh101
Comment options

rh101 Mar 6, 2025
Collaborator

@hasikill
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants