Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
any difference in Sprite class between gideros 2014.10 and 2015.04.18? — Gideros Forum

any difference in Sprite class between gideros 2014.10 and 2015.04.18?

piepie Member
edited April 2015 in General questions
I have a project with a menu which is working well in gideros 2014.10.
I am using GiderosCodingEasy Sprite:show() and Sprite:hide() - as long as Sprite:isHidden() to show/hide some buttons on certain situations.

In Gideros 2015.04.18 the buttons visually hide and show correctly, but they are still responding to touch inputs (which generates a bit of a mess since are overlapping, or "answering" where should be nothing :) any idea on what could cause this? )

Thank you

Comments

  • ar2rsawseenar2rsawseen Maintainer
    @pie so what show and hide does is scales Sprite to 0 on hide and scales it back on show. And the idea was that hitTestPoint won't hit it if the size is 0

    So what happens if you directly scale sprite to 0, does it still respond to input events? That would eliminate possibility of GiderosCodingEasy messing things up
  • @ar2rsawseen - then is the size checked for either being zero and if they are not bother drawing it?
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • piepie Member
    @ar2rsawseen I don't think it's giderosCodingEasy, I'd say it's something in gideros itself.

    Try running attached project (which is a modified copy of button example with giderosCodingEasy)

    On 2014.10 works as expected (hidden or scale = 0 => no response to input),
    On 2015.04.18 sprite scaled to 0 still responds to input events.

    Could Z axis have a role in this one?
    Thank you :)
    zip
    zip
    showhideTest.zip
    18K
  • hgy29hgy29 Maintainer
    Well I think changes in Matrices may have led to this issue. hitTestPoint works by applying inverse transforms of each sprite layer to windows coordinates until they are in local sprite space. The issue with scaling set to 0 is that not inverse matrix actually exists (division by 0) so results are undefined... could you try with setting scale to 0.0001 or something like that ?
  • piepie Member
    edited April 2015
    @hgy29 thanks, I tried scaling down, up to 0.0000000000000000000000001 but the problem persists:
    it doesn't seem to scale the sensible area below 0.1, at scale 0.01 the sensible area seems to get a weird size (I can tell only because I can click it with mouse - I am not certain of that).
    getScale() returns 0.0099999997764826 instead of 0.01 if this could be related..
    [edit. no it shouldn't be related, it's the same value I get in 2014.10 :) ]
  • piepie Member
    I need to fix this or I can't upgrade to latest gideros releases, does someone knows where to look at in the source code?
    I am not sure I have the knowledge to fix it though, but I could always try :)
  • ar2rsawseenar2rsawseen Maintainer
    @pie unfortunately @hgy29 is on vacation now, but it should be somewhere in 2dsg, most probably Matrix related, so the first place I would look to is:

    https://github.com/gideros/gideros/blob/master/2dsg/Matrices.cpp

    Likes: pie

    +1 -1 (+1 / -0 )Share on Facebook
  • piepie Member
    After some attempts I have to admit that I have no chance to understand what's happening and how to fix it #-o

    @hgy29 - I don't want to bother, but you seem to understand where and how this could be happening - if you have some time can you please think about a patch or a workaround? :) I am stuck on 2014.10 due to this bug

    Thank you
  • hgy29hgy29 Maintainer
    @pie, I will look at this asap, tomorrow morning if possible.

    Likes: pie

    +1 -1 (+1 / -0 )Share on Facebook
  • hgy29hgy29 Maintainer
    @pie, Good news for you!

    I've been able to investigate further, the issue was indeed due to non-invertible matrix. Somehow the lib I used for matrix computation returns identity matrix for non invertible matrices (i.e determinant is near 0). I changed this behavior to adopt previous gideros way of doing, which is actually dividing by 0 and producing invalid matrix.
    The fix should be available in next release.
  • piepie Member
    @hgy29 great! :) thank you
Sign In or Register to comment.