#Chess: Graphics drawing multiple transparent shapes ontop of board

13 messages · Page 1 of 1 (latest)

flint saddle
#

I'm drawing the board with a simple setColor and fillRect, but when trying to add a "hint" (small transparent circle in the center of a tile) using alphacomposite and graphics2d, seems to slowly fade to clear as each of the hints are drawn

golden oarBOT
#

This post has been reserved for your question.

Hey @flint saddle! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

flint saddle
#
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, g.getColor().getAlpha() / 255f));
        g.fillRect((col * pieceSize) + (pieceSize / 3), (row * pieceSize) + (pieceSize / 3), pieceSize / 3, pieceSize / 3);
       g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f));
#

in a loop

grand frigate
#

Most likely there is something else in the loop

flint saddle
#

nope just that

#

it may help to know that it works fine if tje background is an image, but when it's drawn manually with fillrect this happens

flint saddle
#

before the code i sent

grand frigate
#

Okay. I believe there is more, but I'm not the one with the code in front of me that I could just copy/paste so that any willing person could try it.

golden oarBOT
#

💤 Post marked as dormant

This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.