Anyone know how to access actor bitmaps in new version ?

designpeg

  • *
  • Posts: 711
I'm updating my games and all si going smoothly, except one bit of code I used to alter the actors animations at runtime.
The new version uses a different way of drawing or storing the animations, and I'm trying to work out what it is.

This used to work to get the bitmap of the animation, which I could then use to alter themby superimposing new bitmaps on top.

_actor.animationMap.get(/* animation name*/).tilesheet.nmeBitmap.copyPixels(/* bitmap data to overlay */, new nme.geom.Rectangle(0,0,10,10)

Now it doesn't work.

If anyone can help I'm thinking of building an extension using the method  - it's a great way to add clothes etc. which I'd put up on here.

rob1221

  • *
  • Posts: 9456
Replace "tilesheet.nmeBitmap" with "bitmapData"

designpeg

  • *
  • Posts: 711
Ahh, so simple when you know how!! thanks rob1221.

designpeg

  • *
  • Posts: 711
Hi Rob, do you know actor animation Map has changed to?

This worked on the 3.4, but not now.
actor.animationMap.get("animation_name").getBitmap();

rob1221

  • *
  • Posts: 9456
getBitmap() just returned tilesheet.nmeBitmap in the old version if testing outside of Flash.  Now it's just "bitmapData" on every platform.

designpeg

  • *
  • Posts: 711