TexturePacker: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>UNiversal
>NedBot
m (Robot: Cosmetic changes)
Line 1: Line 1:
{{DevsHeader|'''XBMC Skin development'''}}
{{DevsHeader|'''XBMC Skin development'''}}


==TexturePacker Explained==
== TexturePacker Explained ==
XBMC uses a tool named TexturePacker to compile all images used in a skin into a single file.
XBMC uses a tool named TexturePacker to compile all images used in a skin into a single file.
The benefit of it is that images inside the Textures.xbt will load faster in the skin.
The benefit of it is that images inside the Textures.xbt will load faster in the skin.
Line 11: Line 11:
than to total size of all the individual images.
than to total size of all the individual images.


==How To Get It==
== How To Get It ==
If you are using Windows, you can simply download an up-to-date version of TexturePacker from the XBMC GIT repo.
If you are using Windows, you can simply download an up-to-date version of TexturePacker from the XBMC GIT repo.
it is available here: [https://github.com/xbmc/xbmc/blob/master/tools/TexturePacker/TexturePacker.exe?raw=true TexturePacker.exe]
it is available here: [https://github.com/xbmc/xbmc/blob/master/tools/TexturePacker/TexturePacker.exe?raw=true TexturePacker.exe]
Line 19: Line 19:
inside the ../tools/TexturePacker directory.
inside the ../tools/TexturePacker directory.


===Missing Dll's error===
=== Missing Dll's error ===
Grab the Dll's from [http://jezzxbmc.googlecode.com/svn/TexturePacker/ Testurepacker] or for newer SDL dll (smaller Texture.xbt see [http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12-win32.zip SDL.dll] keeping them in same directory as Texturepacker executable.
Grab the Dll's from [http://jezzxbmc.googlecode.com/svn/TexturePacker/ Testurepacker] or for newer SDL dll (smaller Texture.xbt see [http://www.libsdl.org/projects/SDL_image/release/SDL_image-1.2.12-win32.zip SDL.dll] keeping them in same directory as Texturepacker executable.


==Usage==
== Usage ==
Since TexturePacker is a command-line tool, you will need to open a dos box/terminal/console in order to run it. The general usage is:
Since TexturePacker is a command-line tool, you will need to open a dos box/terminal/console in order to run it. The general usage is:
<pre>TexturePacker -input skin.name\media -output skin.name\media\Textures.xbt</pre>
<pre>TexturePacker -input skin.name\media -output skin.name\media\Textures.xbt</pre>
Line 33: Line 33:
<pre>TexturePacker -input skin.name\themes\Blue -output skin.name\media\Blue.xbt</pre>
<pre>TexturePacker -input skin.name\themes\Blue -output skin.name\media\Blue.xbt</pre>


===Texturepacker build bat===
=== Texturepacker build bat ===
Create a Texturepacker.bat with the contents below, inside the skin.name directory along with all the texturepacker.exe and dll's, a double click on the bat file does all the work for you.
Create a Texturepacker.bat with the contents below, inside the skin.name directory along with all the texturepacker.exe and dll's, a double click on the bat file does all the work for you.
<pre>
<pre>
Line 60: Line 60:
</pre>
</pre>


==See also==
== See also ==
'''Development:'''
'''Development:'''
* [[Add-on development]]
* [[Add-on development]]

Revision as of 15:49, 27 April 2013

Template:DevsHeader

TexturePacker Explained

XBMC uses a tool named TexturePacker to compile all images used in a skin into a single file. The benefit of it is that images inside the Textures.xbt will load faster in the skin. This is done by converting all images into a format that take less processing by XBMC when they need to be rendered onto the screen.

A common misconception is that TexturPacker will just compress the images into a single file, this if far from the truth, so don't be surprised if the Textures.xbt file is much larger than to total size of all the individual images.

How To Get It

If you are using Windows, you can simply download an up-to-date version of TexturePacker from the XBMC GIT repo. it is available here: TexturePacker.exe

On other platforms, you will have to compile TexturePacker yourself. This is done by compiling XBMC and when the compile is finished, you can find TexturePacker inside the ../tools/TexturePacker directory.

Missing Dll's error

Grab the Dll's from Testurepacker or for newer SDL dll (smaller Texture.xbt see SDL.dll keeping them in same directory as Texturepacker executable.

Usage

Since TexturePacker is a command-line tool, you will need to open a dos box/terminal/console in order to run it. The general usage is:

TexturePacker -input skin.name\media -output skin.name\media\Textures.xbt

Optionally, you can run TexturePacker with the -dupecheck option. This is useful if you have included the same image multiple times in your media folder. For example, if your skin includes a lot of studio logos, most likely a lot of them are included multiple times but with a slightly different filename. The '-dupecheck' option will make sure each unique image is included only once in the Textures.xbt file and thus keeping the size of it as small as possible.

If your skins includes themes you should also run TexturePacker on your theme folders:

TexturePacker -input skin.name\themes\Blue -output skin.name\media\Blue.xbt

Texturepacker build bat

Create a Texturepacker.bat with the contents below, inside the skin.name directory along with all the texturepacker.exe and dll's, a double click on the bat file does all the work for you.

@echo off
ECHO ----------------------------------------
echo Creating excludes

Echo .svn>exclude.txt
Echo .git>exclude.txt
Echo Thumbs.db>>exclude.txt
Echo Desktop.ini>>exclude.txt
Echo dsstdfx.bin>>exclude.txt
Echo build.bat>>exclude.txt
Echo \skin.confluence\media\>>exclude.txt
Echo exclude.txt>>exclude.txt

ECHO ----------------------------------------
ECHO Creating XBT File...

START /B /WAIT TexturePacker -dupecheck -input media\ -output media\Textures.xbt

del exclude.txt

echo Textures.xbt build complete - Scroll Up to check for errors.
pause

See also

Development: