How do I change the fill color of an instanced sprite?

  • If the colors you want are simple and you do not have more than one color in the picture (color family, that is like blue, light blue, dark blue but still blue) other than black and white, then you can:

    Add the Effect Adjust HSL to the sprite you want to use.

    And then in the events, maybe at load layout, you can set the effect parameter to the parameters. Index zero is Hue, and this changes the COLOR. index 1 is saturation, adjust the saturation, that is, max = strong vibrant color, lower = more grey added. index Two changes the BRIGHTNESS, max = white, lower = black. Play with these 3 values to change colors.

    You can "preview" by doing same thing in your photo editor, choose adjust hue/saturation/brightness.. So you know roughly which values you should enter.

    Note, you have to have some color in the field to begin with, this will not work with a entirely black&white picture. Start with like red and from there you can work your way. if you want solid white and solid black you might want to have separate graphic for these.

    Then there's other Effects to use, play around.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Also, if you have more colors in the picture but the other colors are constant, or for different approach, you can make two objects. The first with the static colors, such as black border, shades etc and use transparency, making the color field transparent plus of course the field outside too if you want. And then you add another object aligned exactly under that first one, and on that one you have the color you want and on THAT object you can either use adjust HSL Effect or Replace Color.

  • Thank you helena,

    Your suggestions open up a whole new way to approaching my colour issues.

    I will make a little sample app to see what it looks like. Getting the colours right is very important for my apps.

    As soon as I have the snapping implemented, I will re-visit the colouring of the keys unless I switch to images (but I'd rather keep the file size down).

    Cheers,

    V

    P.S. Your website looks fantastic. I love your work!

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