本文整理汇总了Java中org.bukkit.map.MapCanvas.drawImage方法的典型用法代码示例。如果您正苦于以下问题:Java MapCanvas.drawImage方法的具体用法?Java MapCanvas.drawImage怎么用?Java MapCanvas.drawImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.map.MapCanvas
的用法示例。
在下文中一共展示了MapCanvas.drawImage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
canvas.drawImage(0, 0, img);
if(m!=null) {
if(m.getParameterTypes().length==2) {
if(m.getParameterTypes()[0] == MapCanvas.class && m.getParameterTypes()[1] == Player.class) {
if(m.getReturnType().equals(Void.TYPE)) {
m.setAccessible(true);
try {
m.invoke(null, canvas, player);
} catch (Exception e) {
//e.printStackTrace();
BukkitPlugin.getInst().getLogger().info("Failed to write to map.");
}
}
}
}
}
}
示例2: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
//the image is just for the player who requested a new key
if (image != null) {
canvas.drawImage(0, 0, image);
//release ressources in order to prevent memory leaks
image = null;
}
}
示例3: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
//the image is just for the player who requested a new key
if (image != null && player.getUniqueId().equals(forPlayer)) {
canvas.drawImage(0, 0, image);
//release ressources in order to prevent memory leaks
image = null;
}
}
示例4: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
public void render(MapView view, MapCanvas canvas, Player player) {
if (this.hasRendered) {
return;
}
if (this.cacheImage.get() != null) {
canvas.drawImage(0, 0, this.cacheImage.get());
this.hasRendered = true;
} else {
player.sendMessage(ChatColor.RED + "Attempted to render the image, but the cached image was null!");
this.hasRendered = true;
}
}
示例5: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@Override
public void render(MapView mapView, MapCanvas canvas, Player player) {
if (animated && frameTimes != null && frameTimes.size() > 0)
{
long now = System.currentTimeMillis();
long delay = frameTimes.get(frame);
if (now > lastFrameChange + delay)
{
frame = (frame + 1) % frameTimes.size();
sentToPlayers.clear();
rendered = false;
lastFrameChange = now;
}
}
if (rendered) {
if (priority != null && player != null) {
sendToPlayer(player, mapView);
}
return;
}
BufferedImage image = getImage();
if (image != null) {
canvas.drawImage(0, 0, image);
rendered = true;
}
}
示例6: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@Override
public void render(MapView view, MapCanvas canvas, Player player){
if(!drawn){
canvas.drawImage(0, 0, image.get());
drawn = true;
}
}
示例7: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@Override
public void render(final MapView view, final MapCanvas canvas, final Player player) {
if (this.rendered) return;
this.rendered = true;
BufferedImage image = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB);
Graphics g = image.getGraphics();
g.drawString(TextRenderer.this.text, 5, 12);
if (TextRenderer.this.mapId != null)
g.drawString("Map #" + TextRenderer.this.mapId.toString(), 70, 115);
canvas.drawImage(0, 0, image);
}
示例8: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@Override
public void render(MapView mapView, MapCanvas mapCanvas, Player player) {
mapCanvas.drawImage(0, 0, image);
}
示例9: render
import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@Override
public void render(final MapView view, final MapCanvas canvas, final Player player) {
if (this.rendered) return;
this.rendered = true;
canvas.drawImage(this.imageX, this.imageY, this.image);
}