[messages] [Module Design] Re: Invisible Opacity Level

Tim M timothy.mccarron at sbcglobal.net
Mon Mar 7 07:08:59 MST 2011

You can find the relevant Invisible trait code here

http://vassalengine.svn.sourceforge.net ... a?view=log[1]

You wouldnt want to edit it but make a copied version which you would
change and import as a custom class so It does not affect other modules.
You would probably want this custom class to override/write? how
hideable works. You really need Joel or Mike or Brent or Pieter (who's
done a lot of this lately) tell you specifics here how to do it.

Going over the code it looks like (I think - could be wrong) that it is
using  java.awt.AlphasComposite to create the opacity effect for the
hidden counter specifically the section:

Composite oldComposite = g2d.getComposite();
      piece.draw(g, x, y, obs, zoom);

I'm guessing you are going to want to change the AlphaComposite.SRC_OVER
to 1.0F (which would be Clear).

See http://download.oracle.com/javase/1.4.2 ... osite.html[2]

[1] http://vassalengine.svn.sourceforge.net/viewvc/vassalengine/VASSAL-src/tags/v3_1_15/src/VASSAL/counters/Hideable.java?view=log
[2] http://download.oracle.com/javase/1.4.2/docs/api/java/awt/AlphaComposite.html

Read this topic online here:

More information about the messages mailing list