I tried to resolve this issue.
But it seems to be a little wrong work, but I hope this will help you somehow.
iEditBoxID = CreateEditBox()
SetEditBoxPosition(iEditBoxID, 50, 150)
SetEditBoxSize(iEditBoxID, 300, 30)
SetEditBoxActive( iEditBoxID, 0 )
iSpriteID = CreateSprite(0)
SetSpriteSize(iSpriteID, 100, 100)
SetSpritePosition(iSpriteID, 150, 100)
SetSpriteColor(iSpriteID, 100, 255, 100, 200)
SetSpriteDepth(iSpriteID, 9)
do
if GetEditBoxHitTest(iEditBoxID, GetPointerX(), GetPointerY()) <> 1 and GetSpriteHitTest(iSpriteID, GetPointerX(), GetPointerY()) <> 1
SetEditBoxActive( iEditBoxID, 0 )
SetEditBoxFocus( iEditBoxID, 0 )
endif
if GetPointerPressed() = 1 and GetEditBoxHitTest(iEditBoxID, GetPointerX(), GetPointerY()) = 1 and GetSpriteHitTest(iSpriteID, GetPointerX(), GetPointerY()) = 1
SetSpriteColor(iSpriteID, random(0,255), random(100,255), random(100,255), 200)
SetEditBoxActive( iEditBoxID, 1 )
SetEditBoxFocus( iEditBoxID, 1 )
elseif GetPointerPressed() = 1 and GetEditBoxHitTest(iEditBoxID, GetPointerX(), GetPointerY()) = 1
SetEditBoxActive( iEditBoxID, 1 )
SetEditBoxFocus( iEditBoxID, 1 )
endif
print("edit: "+ str(GetEditBoxHitTest(iEditBoxID, GetPointerX(), GetPointerY())))
print("sprite: "+ str(GetSpriteHitTest(iSpriteID, GetPointerX(), GetPointerY())))
print("BoxActive: " + str(GetEditBoxActive(iEditBoxID)))
Print("Pointer state " + str(GetPointerState()))
Sync()
loop
function GetEditBoxHitTest( iEditBoxIndex as integer, x as float, y as float )
eX# = GetEditBoxX(iEditBoxIndex)
eY# = GetEditBoxY(iEditBoxIndex)
eW# = GetEditBoxWidth(iEditBoxIndex)
eH# = GetEditBoxHeight(iEditBoxIndex)
if x > eX# and x < eX#+eW# and y > eY# and y < eY#+eH#
result = 1
else
result = 0
endif
endfunction result
https://www.instagram.com/qugurun/