Simple textures and animations from ofRect!?


I’ve got a simple snake like game running with openFrameworks. A white line is drawn by the user with ofRect. A black cube then travels back and forth on this line. It’s also drawn with ofRect.

In short. I’m not a graphic designer. This is an audio application and I’ve used these simple applications to get the backend and audio working.

What I want? The black rectangle on the line should be glowing, like a ball of light. The white line that is drawn should have a texture instead of just one simple color.

Im tired. This is solved.

Hey @MaxBjorverud great news – can you share how you solved it (with code or a description) for people that read this later?


in .h I declared “ofTexture texture”

in .cpp i then loaded a texture with “ofLoadImage(texture, “texture.png”);”

The texture is then drawn just as ofRect.

“texture.draw(X, Y, xSize, ySize);”

1 Like