[r112] Opacity Comparison Glitch

  • I've been coding around this glitch for a few weeks now, so here it is: if you test an opacity number, sometimes it turns out false when it shouldn't, for example 7=7 or 15=15. Funny thing, it seems to follow a pattern.

    From my tests, opacity start at 0 going up, the numbers that always come out false are 7, 14, 15, and 28 through 100. When opacity starts at 100 going down, these numbers are 58 - 0. If I start at 0 and skip 2 going up, they're 14, 28, 30, and 56 - 100.

    Here is the download link to a sample .capx I made. One sprite, one text that keeps track of its opacity, and another text that checks the opacity and increases it if true.

    I get the same results every time, on the most recent IE, Firefox, and Chrome browsers. I have a Windows 7 laptop, Mobile Intel(R) 4 Series Express Chipset Family graphics card (chipset) which is up-to-date.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Should be fixed in the next build, was caused by a floating point rounding error. Internally opacities are stored as 0-1, so they're multiplied by 100 to get the C2 value... and it turns out 0.06 x 100 = 6, but 0.07 x 100 = 7.0000000001!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)