Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (612)
Games in Android Showcase (172)
games submitted by our members
Games in WIP (659)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 2D / Re: How to remove previous drawStrings? on: 2003-04-21 19:57:25
That was one of the first things I tried, and it seemed to ignore the alpha component.

I got it working by not even using glass pane though.
2  Java Game APIs & Engines / Java 2D / Re: How to remove previous drawStrings? on: 2003-04-13 12:58:35
Thanks.  I see what you are getting at now.  It was too obvious for my simple mind  :-/
3  Java Game APIs & Engines / Java 2D / Re: How to remove previous drawStrings? on: 2003-04-13 12:36:50
The background is transparent so the board shows through.  When I try to use clearRect the screen gets set to the background color (grey) and hides the board.

I've tried setting the background color to a transparent alpha but that doesn't work.

Essentially, I need to be able to make a specified rectangle clear and be transparent so I can redraw the countdown.

If there is another way, that would be great too.

      void drawBigText(String text) {
            Graphics2D g = (Graphics2D) getGlassPane().getGraphics();
            AttributedString styledText = new AttributedString(text);
            styledText.addAttribute(TextAttribute.FAMILY, "serif");
            styledText.addAttribute(TextAttribute.SIZE, new Float(120));
            styledText.addAttribute(TextAttribute.FOREGROUND, Color.yellow);
            AttributedCharacterIterator i = styledText.getIterator();
            g.drawString(i, 80, 250);
4  Java Game APIs & Engines / Java 2D / How to remove previous drawStrings? on: 2003-04-13 02:30:04
I know this is probably a pretty dumb question, but I'm stumped.

I am trying to use drawString to show a countdown timer.  However, the previous values never clear so I end up with all the numbers overlaying.

I tried to use clearRect but that clears to the background color.  I'm using the glasspane and want to show the countdown over what is already on screen.

How can I remove the text already showing on the glass Pane?
Pages: [1]
Andrew_3ds (12 views)
2015-09-01 19:08:10

afikri (14 views)
2015-08-31 09:30:22

afikri (21 views)
2015-08-31 09:30:07

afikri (10 views)
2015-08-31 09:27:24

afikri (14 views)
2015-08-31 09:26:40

Roquen (17 views)
2015-08-29 11:30:54

GamerC4 (31 views)
2015-08-22 20:38:50

GamerC4 (27 views)
2015-08-22 20:37:18

GamerC4 (31 views)
2015-08-22 20:37:01

Kefwar (40 views)
2015-08-22 18:07:24
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!