rgbaAt - Canvas question

  • Hi Guys, I have a colouring game that at the moment has a thin strip to select the colours and I'm wanting to increase the colours used in the game and have a deeper block shape rather than the strip.

    at the moment I'm using code (canvas)

    Touch > Ontouched colourstrip > system > colourstrip.rgbaAt(Touch.X - colourstrip.X,5)

    but that will only let me sample from the very top of the new block shape, does anyone know a way of being able to sample from the whole block shape area?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 5 is the Y-coordinate on the canvas in your expression.

    If you need to get the color from clicked position, use colourstrip.rgbaAt(Touch.X - colourstrip.X, Touch.Y - colourstrip.Y)

  • Your a star!! That works fine, thank you. I have spent ages trying to fathom it out. I've looked at other capx files (they do it a different way) and googled etc. I was aware what the 5 was from changing the number and testing it.

    Thank you again, thats really helped me out :) - cheers Dave

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