SKPhysicsBody with custom view?

167 views Asked by At

With UIDynamics it is simple to have the physics objects, called dynamic items, control custom views (or indeed anything you want) using the protocol UIDynamitItem with the three properties center, transform and bounds. I would like to do something similar with SpriteKit, but according to the manual:

Unlike views, you cannot create SKNode subclasses that perform custom drawing

Specifically, I would like to have the physics bodies control some vector graphics I currently have in a drawrect. There are two things I am after here:

  1. The first is to let the vector graphics move around like any other node.
  2. The second is to let position, angle and other properties change the exact position of some of the control points.

I am fairly certain that I could achieve this with UIDynamics and dynamic items, but then I wouldn't be able to use actions and other nice sprite kit features.

It would also seem that 1 could be handled by converting the paths to cgpaths and using shape nodes, but that would be limiting, and not cover 2.

Any suggestions?

0

There are 0 answers