Tooltip Interfacing

  ... the case you feel the need for a new feature or want to submit one.

Tooltip Interfacing

Postby Skripi » Sat Jan 01, 2011 1:57 pm

Hey,

I was thinking of a great feature which would include giving entities a tooltip, in that you touch and hold a location and it brings up a tooltip for that entity around where your finger is and moves around with your finger until you release or move your finger off the entity.

Anyone else think this feature would be cool?
Please rush me my portable walrus cleaning kit. Yes I am over 18 but my IQ isn't.
Skripi
 
Posts: 61
Joined: Wed Aug 11, 2010 5:35 pm

Re: Tooltip Interfacing

Postby Br0ken » Sat Jan 01, 2011 5:17 pm

Something like this is easily done with the new EntityContainer, you can add child entities which update relative to the parent entity.

So the Sprite is the parent, the Text is the child, the childs X/Y will update relative to the Sprite's X/Y.
Br0ken
 
Posts: 265
Joined: Sun Sep 12, 2010 3:57 pm

Re: Tooltip Interfacing

Postby Nicolas Gramlich » Tue Jan 11, 2011 6:38 pm

Hi,

Skripi wrote:I was thinking of a great feature which would include giving entities a tooltip, in that you touch and hold a location and it brings up a tooltip for that entity around where your finger is and moves around with your finger until you release or move your finger off the entity.


yes, that is very easy with the new "EntityContainer"-branch, as Br0ken said. In onAreaTouched, when the ACTION is DOWN, attach a child to the Sprite (which is moved along any transformation of its parent) and when there is an ACTION_UP, detach that child.
Don't forget to call "setTouchAreaBindingEnabled(true);" so that you'll always receive the ACTION_UP on the same TouchArea where the ACTION_DOWN occurred.

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany


Return to Features

Who is online

Users browsing this forum: No registered users and 10 guests