Loading...
Forum Rules:
You may only create a new thread here if you have created a guide on how to do something AddOn or WoW related. A guide here should not be dependent on either Tukui or ElvUI. Do not create a thread here if you just want to ask how to do something.

[Guide] Adding Fonts, Textures and Sounds through SharedMedia

1
Adding Fonts, Textures and Sounds through SharedMedia


First Things First
  1. Download and install the SharedMedia AddOn.
  2. If you don't know how to install AddOns, then see this guide: viewtopic.php?f=20&t=10792

Automatic Method (For Windows)
  1. Open the SharedMedia folder (World of Warcraft / Interface / Addons / SharedMedia) and rename MyMedia.bat.txt to MyMedia.bat (make sure you have Windows set to show all file extensions)
  2. Run MyMedia.bat to create the necessary folders
  3. Put your media files into the sub-folders found at: World of Warcraft / Interface / Addons / SharedMedia_MyMedia
  4. Run MyMedia.bat again to create the MyMedia.lua file, which contains the necessary code to register your files
  5. Optional: If you want to edit the in-game name of your newly added media, then open the MyMedia.lua file and change the text in the 2nd set of quotes (see image 5)

Automatic Method: Images
Image


Manual Method
  1. Create a folder named "SharedMedia_MyMedia" inside your addons folder (World of Warcraft / Interface / Addons / SharedMedia_MyMedia)
  2. Create subfolders named "background", "border", "font", "sound" and "statusbar"
  3. Place your media files into the corresponding folders
  4. Create a new text file called "MyMedia.lua", then remove the .txt from the name so the extension becomes .lua. Open the file and insert the following code:

    Code: Select all

    ----------------------------------------------------------------------------
    -- Copy this section of the file to a file called MyMedia.lua, and enter
    -- your medias information, using the examples shown below.
    ----------------------------------------------------------------------------
    
    local LSM = LibStub("LibSharedMedia-3.0")
    
    -- START of the section that you should be editing
    --
    --    NB: any line beginning with "--" is ignored - so the lines
    --    below are just comments!
    --
    
    --background:
    
    --border:
    
    --font:
    
    --sound:
    
    --statusbar:
    
    -- END of the section that you should be editing
    
  5. Use the examples below to add information about your newly added media. You should only need to change anything between the lines marked "START" and "END".
  6. Each item of media that you want to add should have its own line that uses the relevant example as a template. To add details about more than one item, just add another line to that section, changing the specific details (eg, the font name and path).

Manual Method: Examples
  • LSM:Register("background", "my background's name", [[Interface\Addons\SharedMedia_MyMedia\background\mybackground.tga]])
  • LSM:Register("border", "my border's name", [[Interface\Addons\SharedMedia_MyMedia files\myborder.tga]])
  • LSM:Register("font", "my font's name", [[Interface\Addons\SharedMedia_MyMedia\font\myfont.ttf]])
  • LSM:Register("font", "my friend's font", [[Interface\Addons\SharedMedia_MyMedia\font\friendsfont.ttf]])
  • LSM:Register("sound", "my sound's name", [[Interface\Addons\SharedMedia_MyMedia\sound\mysound.mp3]])
  • LSM:Register("statusbar", "my statusbar texture's name", [[Interface\Addons\SharedMedia_MyMedia\statusbar\mytexture.tga]])
Last edited by Deleted User 52 on Mon Jul 17, 2017 3:25 pm, edited 2 times in total.

[Guide] Adding Fonts, Textures and Sounds through SharedMedia

5
rudedude wrote: Fri Aug 09, 2019 4:51 pm Great guide but how do i do this with a mac?
I would like to see this question answered also. I tried following the manual instructions, but my Macbook Pro won't run the .bat file. I got as far as MyMedia showing up on the Addon List in the game, but that's it.

I manually created a .toc file with required dependency SharedMedia, but it doesn't load any of my fonts.

[Guide] Adding Fonts, Textures and Sounds through SharedMedia

9
Something that you might want to pay attention to is the fact that you can only insert .ttf (TrueType Font) files. If you have an .otf (Open Type Font) it wont work.
To fix that, you only change the name from "fontname.otf" simply to "fontname.ttf"
Windows should automatically change the file to a TrueType Font and you should be able to use it ingame.