If else Statement for Drawing Pads


#1

Question about a possible interaction.

Is it possible to have an If, else statement when drawing UI elements on the Lightpad. Effectively, this would force specific pixels to stay inactive after visual events. What function could I call to check if an LED is inactive and store that as a variable to act upon? Wouldn’t that just be alpha?


#2

It works like you would expect, an example from the bricks game:

ballYVec = -1;
if (getRandomInt (255) > 127)
{
    ballXVec = 1;
}
else
{
    ballXVec = -1;
}

About the reading pixels, that is not really, how it is intended. Your repaint() will call the various draw methods. If you want to know, if you have painted a pixel before, you should store that in a variable.

Hope that helps a bit


#3

Thanks a lot!

I knew what I needed to do, but just not how to go about doing it.