当前位置: 首页>>代码示例>>Java>>正文


Java MapCanvas.drawImage方法代码示例

本文整理汇总了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.");
					}
				}
			}
		}
	}
}
 
开发者ID:MeRPG2,项目名称:EndHQ-Libraries,代码行数:20,代码来源:ImageRenderer.java

示例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;
    }
}
 
开发者ID:games647,项目名称:Java-Snippets,代码行数:10,代码来源:ImageRenderer.java

示例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;
    }
}
 
开发者ID:games647,项目名称:SecureMyAccount,代码行数:10,代码来源:ImageRenderer.java

示例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;
    }
}
 
开发者ID:ConnorLinfoot,项目名称:MC2FA,代码行数:16,代码来源:ImageRenderer.java

示例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;
    }
}
 
开发者ID:elBukkit,项目名称:MagicLib,代码行数:29,代码来源:URLMap.java

示例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;
	}
}
 
开发者ID:CirnoTheGenius,项目名称:ImgMap-BufferOverflow,代码行数:8,代码来源:ImageRenderer.java

示例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);
}
 
开发者ID:Howaner,项目名称:FramePicture,代码行数:14,代码来源:TextRenderer.java

示例8: render

import org.bukkit.map.MapCanvas; //导入方法依赖的package包/类
@Override
public void render(MapView mapView, MapCanvas mapCanvas, Player player) {
    mapCanvas.drawImage(0, 0, image);
}
 
开发者ID:DemigodsRPG,项目名称:CensoredLib,代码行数:5,代码来源:BukkitImageUtil.java

示例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);
}
 
开发者ID:Howaner,项目名称:FramePicture,代码行数:7,代码来源:ImageRenderer.java


注:本文中的org.bukkit.map.MapCanvas.drawImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。