简体   繁体   English

Java 2d游戏:imageUpdate()

[英]Java 2d Game: imageUpdate()

I am working on a Java 2d game, I want to make a method, to check id the images i will update are allready being rendered completely, if they are, then they are not going to be re-drawed. 我正在开发一个Java 2d游戏,我想做一个方法,检查id我将更新的图像是否已经完全渲染,如果已经渲染,则它们将不会被重新绘制。

And now i am stuck. 现在我被困住了。 I searched for a way to do this and i found that imageUpdate(Image, InfoFlags, x, y, w, h) its the best method that fits my needs. 我搜索了一种方法来执行此操作,然后发现imageUpdate(Image,InfoFlags,x,y,w,h)是满足我需要的最佳方法。

I think(anyone correct me if i am wrong) That this returns false if the image is not complety rendered. 我认为(如果我错了,任何人都可以纠正我)如果图像未完全呈现,则返回false。

Here are my questions. 这是我的问题。 What are Info Flags? 什么是信息标志? Can anyone give an exmaple of this method? 任何人都可以举例说明这种方法吗? Do I need an Image Observer? 我需要影像观察器吗? What is an ImageObser and what it does? 什么是ImageObser及其功能?

Thanks 谢谢

Did you take a look at the java docs? 您是否看过Java文档? They should be able to answer your question. 他们应该能够回答您的问题。

http://docs.oracle.com/javase/7/docs/api/java/awt/image/ImageObserver.html#imageUpdate(java.awt.Image , int, int, int, int, int) http://docs.oracle.com/javase/7/docs/api/java/awt/image/ImageObserver.html#imageUpdate(java.awt.Image,int,int,int,int,int

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM