Jump to content

Getting bitmapData of a cachedBitmap


mr_mg
 Share

Recommended Posts

Hi guys,

I have a sprite sheet I use to create my level from. I then detect which tile a player is over and I then want to use bitmap data to read the colour of the pixel under the player. My tiles have transparent edges to them and are irregular shapes so when trimming them in TexturePacker they aren't at their original size.

I'm struggling to find a way to get the bitmap data correctly. It seems to only work on whichever sprite is in the top left of the spritesheet. To get round this I thought if I cached the current tile as a bitmap I could then use _cachedBitmap but it doesn't seem to work. Is there a way to copy that content to a bitmapdata or can anyone else think of a solution.

Thanks

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...