Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

2D animation/transparency question

 
Mich Robinson
Ranch Hand
Posts: 260
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just written a simple game of Connect 4 but I can't work out how to make the pieces slide in behind the grid to make things look more real. I currently have the grid displayed on a wooden background which I like and I'd also like the image of the wood to show through the holes in the board. Any ideas?

Obviously I could just display the pieces over the top of the grid but this stops me from being able to animate the sliding of a piece in behind the grid. Not sure if that made sense but here's the game - how do I simulate sliding pieces in at the top? I'm just a bit stuck.
Mike
 
Mich Robinson
Ranch Hand
Posts: 260
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved by using the paint.net to generate images with transparent areas. I then just drew the background image first, then drew the pieces on top of that and then finally drew the grid with the transparent areas on the top. It all worked fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic