Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions FutileProject/Assets/Futile/Extras/FButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ virtual public bool HandleSingleTouchBegan(FTouch touch)

virtual public void HandleSingleTouchMoved(FTouch touch)
{
if (!_isTouchDown) return; //If button is disabled, we still get the HandleSingleTouchMoved event but _isTouchDown is false, and we don't want to change the button state in that case

Vector2 touchPos = _sprite.GetLocalTouchPosition(touch);

//expand the hitrect so that it has more error room around the edges
Expand Down Expand Up @@ -234,6 +236,8 @@ virtual public void HandleSingleTouchMoved(FTouch touch)

virtual public void HandleSingleTouchEnded(FTouch touch)
{
if (!_isTouchDown) return; //If button is disabled, or if mouse/touch went out of the expandedRect, we don't want to send the click Signal

_isTouchDown = false;

_sprite.element = _upElement;
Expand Down