Friday, August 12, 2011

Is there a web-embeddable skin preview application?

Question

So, I'm working on a website for my Minecraft server, and we're looking at creating pages for each of the admins/mods, with some info about them. I'm trying to find a way that I can embed a 'skin preview' of each player's skin onto their respective pages. I suppose we could also just use screenshots, but I think a skin preview would look nicer. Any suggestions?


Edit: This website uses a Java applet, but I'm not 100% sure how to implement this myself.

Answer

Minecraft.net does have a skin viewer available, as long as you're only trying to view existing users' current skins rather than previewing them straight from .png files. To invoke it, add the following code to your page:

<applet code="net.minecraft.skintest.ModelPreviewApplet"
  archive="http://www.minecraft.net/skin/skintest.jar" codebase="."
  width="320" height="320">
    <param name="name" value="535" />
</applet>

(Change 535 to whatever username you want to view.) I've set up an example on jsFiddle.

If you want to preview arbitrary skins, the applet used by Planet Minecraft appears to be available for public use (it points to a forum post, though that thread doesn't appear to mention PMC's previewer). Still, I'd recommend sending them an email first, just in case.

No comments:

Post a Comment