本文介绍了Java在屏幕上绘制图像,然后将其删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

我想在屏幕上绘制图像,然后将其删除,但是有一个小问题.

我可以轻松地绘制它,但是随后要移除它时,我只是不知道该怎么做.
不,不仅仅是用背景颜色填充图像的位置,这不是那么容易.

我试图开发的程序是一个游戏,实际上是一条蛇.一条无尽的,所以我的蛇没有端点,只有一条正在旋转的头.

因此,当我绘制图像时,我希望程序在蛇下绘制它,所以我已经绘制的图像不应删除.

当蛇获得奖金(即图像)时,应通过重画顶部的图形将其从屏幕上移除.

图片:
http://imageshack.us/m/840/2449/nvtelenx.png [ ^ ]

Hello!

I would like to draw an image on the screen, and then remove it, but there''s a little problem.

I can easily draw it, but then when it comes to remove, I just don''t know how.
No, not simply filling the image''s location with the background color, it isn''t that easy.

The program I am trying to develop is a game, actually a snake. An endless one, so my snake doesn''t have an endpoint, just a head which is going.

So when I draw the image I want the program to draw it UNDER the snake, so which I have already draw should not be delete.

When a snake takes the bonus (which is the image), it should be removed from the screen by redrawing which was on the top of it.

A picture of it:
http://imageshack.us/m/840/2449/nvtelenx.png[^]

推荐答案




这篇关于Java在屏幕上绘制图像,然后将其删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 16:44