Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to edit NODE's property in Flutter? #2

Closed
sulater opened this issue Jul 31, 2018 · 3 comments
Closed

How to edit NODE's property in Flutter? #2

sulater opened this issue Jul 31, 2018 · 3 comments

Comments

@sulater
Copy link

sulater commented Jul 31, 2018

Like this:
gif

@luigi-rosso
Copy link
Contributor

We'll be extending the example to include some controllers that will make this easier to do in Flutter soon. Right now you can do this by extending the logic in nima_actor.dart.

You would query for the node when you want to change it:

ActorNode eyes = _actor.getNode("Eyes");
if(eyes is ActorNodeSolo)
{
	eyes.activeChildIndex = 0; // set to closed
	eyes.activeChildIndex = 1; // .. or set to open
	eyes.activeChildIndex = 2; // .. or set to angry
}

I'll post a note when we have an example specifically showing how to do this on top of the existing example.

@sulater
Copy link
Author

sulater commented Aug 8, 2018

thanks so much, 👍

@sulater sulater closed this as completed Aug 8, 2018
@luigi-rosso
Copy link
Contributor

Here's an example of how to use a controller to manipulate the properties of a node. In this example I'm changing the translation property but you could do the activeChildIndex of an ActorNodeSolo as shown in my previous message.

This is the full example:
https://github.com/2d-inc/Nima-Flutter/tree/master/example/ik

Specifically, the controller that does the manipulation is here:
https://github.com/2d-inc/Nima-Flutter/blob/master/example/ik/lib/aim_controller.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants