N
N
Neonoviiwolf2015-06-13 16:30:38
ActionScript
Neonoviiwolf, 2015-06-13 16:30:38

How to bind graphics to Nape in AS3?

Good afternoon!
Help me solve the problem, I decided to use Nape instead of Box2D in the application (the box slows down). Google search reveals what to write:
var box = new Body(BodyType.DYNAMIC);
var movic:MovieClip = new MovieClip(); //here is some movie with graphics
......................
box.graphic = movie;
So, it looks like there is no graphic in the new edition of Nape, then what should I use? Of course, I can write a crutch, but this will only pull even more difficulties

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Porcelain, 2015-10-29
@Porcelain

Body has a userData property where you can store anything you want, including links to graphics. For example, like this:
box.userData.graphic = movic;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question