問題描述
有人知道可以創(chuàng)建 Pixelart 頭像的 JavaScript 或 jQuery 庫嗎?我希望使用組件創(chuàng)建具有 Mr. Potatohead 風(fēng)格的面孔并生成 GIF.
Is anyone aware of a JavaScript or jQuery library that enables the creation of Pixelart avatars? I'm hoping for something with a Mr. Potatohead style face creation using components and resulting in a GIF.
如果沒有,我想我需要自己制作一個.
If not, I guess I'll need to make one myself.
推薦答案
你可以試試Blockies.
它的使用非常簡單(來自 README):
Its usage is pretty simple (from the README):
var icon = blockies.create({ // All options are optional
seed: 'randstring', // seed used to generate icon data, default: random
color: '#dfe', // to manually specify the icon color, default: random
bgcolor: '#aaa', // choose a different background color, default: white
size: 15, // width/height of the icon in blocks, default: 10
scale: 3 // width/height of each block in pixels, default: 5
});
其中 icon
是一個畫布元素.
where icon
is a canvas element.
但是,您無法真正計劃要獲得什么:您最終會得到一個隨機圖標(biāo),除非您指定生成它的種子.
You can't really plan what you're going to get, though: you just end up with a random icon unless you specify a seed to generate it from.
這篇關(guān)于用于創(chuàng)建頭像的 jQuery/JavaScript 庫?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!