Cheap way to do array of buttons?

1 favourites
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • oosyrag haha that's a worthy interruption, thanks. I'm hoping to have a demo up in about a week,

  • You can use HSL. & Since your colors have all kinda the same brightness & luminosity, you only have to lerp the Hue.

    But, i have no idea how you gonna end up with the same color as the background colors, that way.

    The Hue is more like a clock.. Its units are rather in degrees on a color wheel. Should be.

    A hue of zero degrees color should be red. 60 degrees should be yellow. 120 should be green. 240 should be blue. 360 should be red again. This also means that if you change the hue from 240 to zero, you see the color change from blue, over green, over yellow, till it is red.

    But, we talk about an effect. An effect is changing the existing sprite (its existing color).

    So, the color is actually 'the existing hue of the sprite, as made in the sprite editor' + 'the hue in effect'.

    Again, should be.

    This would mean that ...

    If the sprite = blue

    ... the resulting color = hue for blue + hue in effect ..

    .. or

    the resulting color for hue for blue + 360 should be blue again.

    And that is not happening at all, test it and you will see.

    If you start with a blue sprite, and set the hue in the effect to 360, the resulting color is close to black.

    And that should for sure not happen, because that comes down to a change in the luminosity.

    Besides that. I dont understand the units for the hue in the effect.

    If you start with a red sprite, a hue of 30 gives already green as the resulting color.

    That should be (if hue is in degree units as used every where else, virtual everywhere else) red sprite + 120 as value in the effect.

    Now lets assume that 360 is scaled to 100. Or 100% = 360 degrees. This is done a lot in the effects.

    Then, starting from red ... green = a 33 hue in the effect. Okay, that seems to hold.

    But, then staring from red, a hue of 100 should give red again. Again. This is not happening.

    So the last 20 % of the range 0 to 100 % for the hue value is completely useless.

    I have the problem with luminosity. It is an effect. So the resulting luminosity = the existing luminosity *+-%/ the luminosity value in the effect. I just did not figure out this operator (*+-%/) yet. I have really no idea !

    So excuse me for not being a big help.

    Nevertheless, lets do it.

    https://www.dropbox.com/s/0mybm78ildju2 ... .capx?dl=0

    Same thing, but now with HSL.

    Notice 3 things.

    1/ the starting values for the 'dude' can not be 0,0,0. They must kinda match red. The color we start the 'dude' with.

    2 / I never get those nice pastel colors matched. Because i dont understand the luminosity values. Mayby you can. My understanding of color wheels dont match at all with this concept for luminosity.

    3 / purple is out of the box, because its matching hue value is bigger then 80. So its somewhere in the complete useless range hue = 80 - 100 %

    Hope this helped you, it did not help me, because i had to dive into this HSL effect that hate from my toes up into the unlimited sky.

  • 99Instances2Go I have matched them all except for the purple (you're right about the last 20% being totally useless) using just the hue value but I'm sure I can get around this with a bit of fiddling.

    My issue now being you have to hold the click for a second in order for the full color to "develop", what would you suggest to force it to always finish the transition? Is it as simple as putting a wait in there before re-positioning the picker?

    Thanks for braving the HSL landscape for me, I can see why it wouldn't be your favorite! Adjust Hue by Rojo seemed to work great but it causes some transparency issues on iOS.

  • Dont use lerp, set the color instantly. The lerp takes time.

    Or

    set the timer faster. Set it to 0.5 seconds, if you dont wanna wait 1 second.

    But ...

    Then the lerp is then ... lerp(dude.l,color.l, dude.Timer.CurrentTime("color") / (1/0.5)) <-- 0.5 stands for the timer time

    Or

    If you want it to only be instantly on the first touch.

    Dont start the timer when previousTouched = -9

    Set the values instantly when previousTouched = -9

    Still, is using replace color, as i did in the first attempt, not a lot smoother ?

  • 99Instances2Go, it was a lot smoother I was just having some troubles with the shadow color on the sprite, maybe I should revisit this as I'm not very familiar with the replace color effect.

    The transition setup would be ideal, it's the fact that it abandons the transition halfway through unless the mouse is still down. I would like it to always arrive at the destination color. I already fixed this by keeping the picker in place, just worried that you had it moving out of view for a reason.

    I could definitely get by with the instant solution though, damn you're thorough

  • I just discovered my purple..at -19, which kind of ruins the transitions. I think I will keep it instant until I tackle replace color again. Thanks again for the help 99Instances2Go

  • 99Instances2Go Haha I see that's why I get the confusion as I had a text on the screen for debugging and the sooner I release the mouse left button it was going back to -9, but I understand perfectly now is because if we don't select anything on line 7 will be (touch) false for the next thick and by the time it reach line 5 because touch is false it will reset it back to -9

    I thank you so much for the teaching and for all your patient, you are awesome, I learned and I'm learning a lot from you every day, I now understand more about how the logic works in construct 2.

    I had a problem with trying to store the "prepreviousObject" that had a Master variable true and I didn't manage to do it because it was always conflicting when I was setting a new object as a "Master" as I had to reset at the same time the "prepreviousObject Master" to false, it was resetting both of them the old and the new one to false, you gave me the key now how to implement it.

    Thank you and have a great day

  • shaundraws

    Why not use a second sprite as shadow? Pin it.

  • tarek2

    YrSVW

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • shaundraws

    Since you outsmarted me by finding purple in the negatives, i can offer you a better solution.

    Now a touch changes immediately, a swipe is smooth.

    But you have to change your initial design (following a colorwheel). I dont know if that is a big or a small thing.

    For most (well read 'all') graphical designers, i work with, is any change a big thing.

    https://www.dropbox.com/s/vdrub8kut7s6i ... .capx?dl=0

    Now it is done in 4 events (can be done in 2 too, if you leave out the adaption to different screens).

    Cheaper i cant offer no more !

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