Java 资源加载库 Azzet

码农软件 · 软件分类 · 常用工具包 · 2019-08-15 05:58:23

软件介绍

Azzet 是一个简单的 Java 类库,用于从不同的源中加载资源。

示例代码:

BufferedImage img = Assets.load("http://www.google.com/logos/classicplus.png"); // loaded from website
Font fnt = Assets.load("myfont.ttf", new FontInfo(32.0f)); // loaded from classpath
Clip snd = Assets.load("C:\UserData\MyMusic.wav"); // loaded from file-system
BufferedImage gif = Assets.loadFrom("mygif.gif", BufferedImage.class); // you can request the return type
BufferedImage[] animatedGif = Assets.loadFrom("mygif.gif", "db"); // loads from DatabaseSource saved as "db"
Properties props = Assets.loadFrom("app.properties", "tcp"); // loads from TcpSource saved as "tcp"

支持的格式包括:

支持的数据源:

  • Classpath

  • File-System

  • Database

  • JAR

  • FTP

  • HTTP/HTTPS

  • UDP

  • TCP

  • SSL

  • UDP Multicast

示例代码:

FutureAssetBundle bundle = new FutureAssetBundle();
bundle.add( Assets.loadFuture("image.gif", BufferedImage.class) );
bundle.add( Assets.loadFuture("sound.wav", Clip.class) );

BufferedImage image = null;
Clip sound = null;

// game loop
while (running) {
   // do stuff
   // this occurs during the loading screen....
   if (bundle.isComplete()) {
       bundle.loaded(); // notify all FutureAsset implementations the asset has been accepted.
       image = bundle.getAsset("image.gif");
       sound = bundle.getAsset("sound.wav");
       // move from loading to play screen
   } else {
       display bundle.percentComplete();     
   }
   // do other stuff
}

本文地址:https://codercto.com/soft/d/12388.html

零基础学Minecraft编程

零基础学Minecraft编程

Martin O''Hanlon、David Whale / 中文Minecraft Wiki翻译团队 / 人民邮电出版社 / 2015-9-7 / 79

在你体验Minecraft冒险的同时,学习宝贵的编程技能! 如果你很喜欢玩Minecraft,却被游戏中的建造耗费大量时间而困扰,并且你想要对游戏添加一些改动,那么本书就是为你而设计的。在游戏中,你可以学习许多Python编程技能,在PC、Mac或树莓派上与游戏进行互动。这些冒险不仅局限在虚拟世界——你也将会学习如何将Minecraft与电子元件连接起来,这样你的Minecraft世界就能够......一起来看看 《零基础学Minecraft编程》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试