PDA

View Full Version : Question on TouchStripComponent



darkchazz
01-11-2014, 05:12 PM
How can I stop the component from registering touch when I move my finger outside the boundaries of the parent entity?


Also, if I may ask, how does the "m_pBmpBorderFileName" variable from the rectangle render component work exactly?
I tried to set a rttex file but it made no difference whatsoever.

darkchazz
01-14-2014, 02:24 PM
Bump........... :)

Seth
01-15-2014, 01:34 AM
Hey darkchazz,

I'm not sure about the first question.. you could probably add a input filter to the parent so the child won't get the messages. I use that component for the touch pad usually so it's always on top for me, not in a scrolling menu or anything so I'm not sure.

On the second one, here is how to make a bitmap border rect:

Entity *pQuickToolBG = CreateOverlayRectEntity(pBG, ..size stuff..., DEFAULT_RECT_MIDDLE_COLOR);

//preset up the bitmap we'll use, only have to do this once really
GetResourceManager()->GetSurfaceAnim("game/gui_box.rttex")->SetupAnimBySize(10,10);

pQuickToolBG->GetComponentByName("RectRender")->GetVar("bmpBorderFileName")->Set("game/gui_box.rttex");

And that should be it. The rect border should now look like those on Growtopia, if you use the attached image.

24580

darkchazz
01-15-2014, 03:44 PM
Hi Seth, thanks for the informative reply!


I'm not sure about the first question.. you could probably add a input filter to the parent so the child won't get the messages. I use that component for the touch pad usually so it's always on top for me, not in a scrolling menu or anything so I'm not sure.
I'm not using it in a scrolling menu...
Actually I use a touchpad as well and I'm having a problem with it: if I press and hold the pad and then move my finger outside the pad without releasing it, the touchpad is still being pressed until I lift my finger.
Usually I wouldn't care but I have a couple of touchpads each on the opposite side of the screen. Pressing on one then moving my finger to the other messes things up :panic:


And about the rectangle border. Turns out I made the mistake of applying the border image to "m_pBmpBorderFileName" instead of "bmpBorderFileName" :sweatdrop:
Good example though
Thanks

Seth
01-15-2014, 11:35 PM
Try using TouchHandlerArcadeComponent instead of TouchHandlerComponent in your buttons - this new version fixes a lot of issues.

darkchazz
01-16-2014, 01:35 AM
Works like a charm!
problem solved. thanks :)