Results 1 to 2 of 2

Thread: Button click hotspots

  1. #1
    Lesser Wizard
    Join Date
    Nov 2010
    Los Angeles, California, United States, United States

    Default Button click hotspots

    I'm noticing that (specifically in Windows) when two buttons are near each other, clicking on the edge of one causes both to activate. Is there any way to control this, or increase the 'touch sensitivity' for components?

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002


    The TouchHandlerComponent automatically adds space around a button to make it more sensitive:

    In its OnAdd it changes the "touchPadding" var of the parent entity:

    m_pTouchPadding = &GetParent()->GetVarWithDefault(string("touchPadding"), Variant(CL_Rectf(20.0f, 5.0f, 20.0f, 15.0f)))->GetRect();
    To disable this extra sensitivity padding, do this to your button entity:

    I think you can also set negative values if you don't want the whole text/bitmap area to be touchable as well.

    But on a side note, with recent finger tracking additions it would be pretty simple for me to let buttons "claim" a click and not allow one touch to trigger two buttons at once.. hrm, might add that.
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. Replies: 1
    Last Post: 01-30-2011, 10:58 PM
  2. Button Bug?
    By madmark in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 02-10-2009, 08:33 PM
  3. GUI button question
    By Veitikka in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 11-26-2007, 05:49 AM
  4. Button ID
    By madmark in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 09-25-2007, 09:09 PM
  5. feature request - context click on map switcher
    By whisperstorm in forum Novashell Game Creation System
    Replies: 0
    Last Post: 02-07-2007, 03:49 PM



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts