Mii
The best way to display user's Miis
When you want to source Mii imagery from a user, you use a mixture of JavaScript and the miip protocol. This is useful for identifying various users to send letters to, with all of its 64x64px action.
1
var mii = new wiiMii();
Copied!

Members

Member Name
Discussion
mii.getMiiNum()
Returns the amount of Miis this console has. Will not exceed 100.
mii.isValidIcon(index)
Returns a boolean if the Mii at number index exists. This is helpful when looping to access via index from 100.
mii.getMiiName(index)
Returns a string with the Mii at index's name.

Protocol

You have two ways of accessing Miis: via an index (IDX), or using the Mii's character ID (CID).
Regardless of what method, the miip:// protocol accepts a basic format:
1
miip://METHOD/IDENTIFER.bmp?bgR=red&bgG=green&bgB=blue&width=64&height=64
Copied!
You need to set a few params in order to use such a URL.
  • METHOD must be IDX or CID.
  • IDENTIFIER is the value relating to what's mentioned above - be it an index of a Mii, or a friend's character ID.
  • bgR, bgG and bgB are the background of the Mii image in integer values. Instead of 0xff in hexadecimal, you would write 255.
  • width and height are the rendered size in pixels of this bmp.

IDX

Nintendo imposes a max of 100 Miis. Due to this, you can iterate an index from 0-99 and call wiiMii#isValidIcon(index) to verify its validity.
For example, to show the images of all valid Miis and log names using the functions above:
1
var mii = new wiiMii();
2
3
trace("Amount of Miis on console: " + mii.getMiiNum());
4
for (var i = 0; i < 100; i++) {
5
if (!mii.isValidIcon(i)) {
6
trace("Mii #" + i + " is not a valid Mii.");
7
} else {
8
trace("The Mii at index " + i + " has the name of " + mii.getMiiName(i) + ".");
9
// Append a new image element for all Miis with a yellow background.
10
var elem = document.createElement('img');
11
elem.src = "miip://IDX/" + i + ".bmp?width=48&height=48&bgR=255&bgG=205&bgB=0";
12
document.body.appendChild(elem);
13
}
14
}
Copied!

CID

Every Mii has a unique ID (known as a Mii ID, character ID, or CID) derived from its creation timestamp and other data. (For more information, read the WiiBrew article.)
When you utilize NWC24 to retrieve the user's friends list, you are able to query a friend's attached Mii and retrieve a usable CID. (For more in-depth information about the friends list, see its available methods.) Internally, the CID is converted to a usable index.
For example, to iterate through all available friends and show their respective Miis:
1
var nwc24 = new wiiNwc24();
2
var friendAmount = nwc24.getFriendNum();
3
4
trace("Amount of friends on console: " + friendAmount);
5
6
for (var i = 0; i < friendAmount; i++) {
7
// Print information about the Mii for reference.
8
var cid = nwc24.getFriendInfo(i, "miiImage")
9
trace("The friend at index " + i + " has a CID of " + cid + ".");
10
11
// Append a new image element for all Miis with a yellow background.
12
var elem = document.createElement('img');
13
elem.src = "miip://CID/" + cid + ".bmp?width=48&height=48&bgR=255&bgG=205&bgB=0";
14
document.body.appendChild(elem);
15
}
Copied!
Last modified 1mo ago
Copy link