Article View: borland.public.jbuilder.java.language
Article #8271Re: DESPERATE !!!
From: John McGrath TeamB
Date: Wed, 04 Apr 2001 09:12
Date: Wed, 04 Apr 2001 09:12
38 lines
2337 bytes
2337 bytes
On Mon, 02 Apr 2001 11:40:04 +0200, Carlos Ojea Castro wrote:
> Well, I was thinking in a pacman game. The idea is to
> draw a background image (TableroImg, with the "yellow
> points") and several other images (the pacman) over
> the background. The pacman is black in its borders,
> so it will erase the yellow points of the background as
> it moves. That is the reason I want to draw the
> background only once. If I draw the background every
> time then no yellow point will be erased.
But if you do that, you will end up painting over the PacMan.
I think the problem is with your PacMan image. If the area within the
image rectangle but outside of the image of the PacMan is black, then
you will have the problem no matter how you draw it. The solution is
to make the background of the image transparent. The Java Graphics
class knows how to handle transparencies in images.
> Solution seems to be to ensure the gif has completely
> loaded in the init() method before attempting to
> display it.
>
> Could you show me how can I do that?. I am a newbie
> in Java...
As I said, I don't think that will fix your problem. But you can wait
for images to load using the MediaTracker class.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.15347c9ef7b56f598a0ef@forums.borland.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!zeus.visi.com!news-out.visi.com!hermes.visi.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3AC361A6.21A4F47E@rslcom.es> <3ac36a85_1@dnews> <3AC46592.98908578@rslcom.es> <3ac4cec4_2@dnews> <MPG.152f3e28f1c3944298a0dc@forums.borland.com> <3AC848F4.D61DF840@rslcom.es>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,e3fc9de084362442 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-04-04 02:30:04 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.language Subject: Re: DESPERATE !!! Date: Wed, 4 Apr 2001 05:12:41 -0400 Message-ID: <MPG.15347c9ef7b56f598a0ef@forums.borland.com> References: <3AC361A6.21A4F47E@rslcom.es> <3ac36a85_1@dnews> <3AC46592.98908578@rslcom.es> <3ac4cec4_2@dnews> <MPG.152f3e28f1c3944298a0dc@forums.borland.com> <3AC848F4.D61DF840@rslcom.es> X-Newsreader: MicroPlanet Gravity v2.30 NNTP-Posting-Host: 209.92.40.60 X-Trace: dnews 986375562 209.92.40.60 (4 Apr 2001 02:12:42 -0700) Lines: 38 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!zeus.visi.com!news-out.visi.com!hermes.visi.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews