Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Combining TextField with moving Sprite  RSS feed

 
el Toro
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to add a textfield to a graphic which is moving over the screen.
Can someone please point me in the right direction. I'm kind of lost at this point.

What do I already have:
Several moving images.

What do I want:
Showing status information (e.g. location) of the moving image. The information should be grouped with the image and also be moving.

Thanks for you help.
 
el Toro
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found a solution.

I think I was overcomplicating the problem.
Turns out you don't need a text-field. A String will do nicely, because it is repainted each time the paint method is called.
Also there is no need to combine the graphic with the String. They are combined over the position:

sample from my code
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!