Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editboxes break sprite hit testing #1120

Open
JohnStabler opened this issue Nov 22, 2023 · 1 comment
Open

Editboxes break sprite hit testing #1120

JohnStabler opened this issue Nov 22, 2023 · 1 comment
Assignees
Labels
AGK-Core Issue is in the AGK core bug Something isn't working Low priority

Comments

@JohnStabler
Copy link

Using GetSpriteHitTest(spriteId, x, y), if the sprite is on top of an edit box then the hit test will fail.

For example, I've implemented my own UI modal window that pops up on top of a bunch of edit boxes to give the user feedback about the data they're entering. If they try to click a sprite button that is above an edit box, nothing is detected.

I have a workaround using SetEditBoxActive(editBoxId, 0) on all edit boxes in the layer below which fixes the problem. However, it's not ideal as GetSpriteHitTest() should always tell you if the point is inside the sprite's hitbox.

@VirtualNomad19
Copy link
Collaborator

VirtualNomad19 commented Nov 24, 2023

hey, john. i've seen the issue on the forums and similar solutions to yours but have you tried GetSpriteHitGroup() instead where i'm wondering if the edit boxes are using sprites internally in some way that may be in the same group as actual sprites?

with that, i thought i saw reference to Groups in the source regarding Edit Boxes with no way to set/get those groups similar to the built-in physics walls which we can't reference directly either while i assume both systems are basically helper-functions utilizing existing command sets that try to make things easier and acknowledging that Input commands, i expect, are precisely that (vs raw input) and are:

guaranteed to function in some way on all platforms

regardless, i'll tag it up appropriately.

@VirtualNomad19 VirtualNomad19 added bug Something isn't working AGK-Core Issue is in the AGK core Low priority labels Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AGK-Core Issue is in the AGK core bug Something isn't working Low priority
Projects
None yet
Development

No branches or pull requests

3 participants