Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Sprite does not receive touch events when created outside of the visible area and then moved inside. — Gideros Forum

Sprite does not receive touch events when created outside of the visible area and then moved inside.

I have menus and "drawers" that are build and attached to the scene three outside of the visible area. Then on some user action the menu glides in the visible area. After upgrading Gideros the menu item sprites stopped receiving touch events. I have been using this code for 9 years and now none of my menus and drawers are working.

If I create the menu inside of the visible area - the touches work.

I guess there is an easy fix for that, but can't figure it out.

Please help.

After a few years I decided to upgrade Gideros from 2021 to the latest version (2023.6).
All my projects stopped working (due to luau, module def changes, "bit" removed, etc).
It took me a day or two to revive one of the projects, but I have issues I can't resolve. Such as the one above and Android back button KEY_UP event not firing while KEY_DOWN is firing fine.

Likes: MoKaLux

+1 -1 (+1 / -0 )Share on Facebook


  • kussakovkussakov Member
    edited July 3
    One more test: When I create the slide menu to be initially "half visible" (half of the buttons are in the visible area and half outside) only half of the buttons receive touches when I slide the menu to be fully visible.

    I use GTween to move the slider in visible position.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    I had a quick look at the code, I thought it could be caused by 'set()' call used by GTween not properly updated with the various changes, but no they look ok. Any chance you could send me a small test project that exhibits the issue ? I'll try to test on my side with debugger, but rewriting it my way I could compltely avoid what causes the issue.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • kussakovkussakov Member
    edited July 4
    @hgy29 It could very well be related to set() used by GTween.
    After reading your comment I did another test: Instead of using GTween for the slide effect I just did setPosition on the main slider. This time all touches work. This is now my workaround (to loose the slide effect while we figure it out).
    I will try to write a sample project, but there is too much code involved and I have to simplify it...

    Maybe not. I just did another test:
    -- in GTween replaced this:
    			self.target:set(n, val)
    -- With this:
    			if n == "x" then
    				self.target:setPosition(val, self.target:getY())
                                    -- self.target:setX(val)
    			elseif n == "y" then
    				self.target:setPosition(self.target:getX(), val)
                                    -- self.target:setY(val)
    				self.target:set(n, val)
    Still does not work. Must be something else GTween is doing... will keep digging.
  • keszeghkeszegh Member
    @kussakov , i encourage you to send your whole code to @hgy29 in a pm, i did this in the past many times and he always found the issue much faster this way. and i'm completely sure that your code is safe with him (and he will delete it afterwards if you ask him), as proven by my experience. but of course it's just an option that i recommend.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    @kussakov, any news on this ? I didn't manage to reproduce it, and couldn't find an obvious issue in Gideros code.
Sign In or Register to comment.