-
Notifications
You must be signed in to change notification settings - Fork 1
Creating Texture Packs
Creating a texture pack is simple. All you need is to create a folder containing your new textures and a config file with the following:
HUDReplacer:NEEDS[HUDReplacer]
{
filePath = GameData/YourMod/PluginData/
priority = 0
onScene = SPACECENTER
}The options are:
-
filePathstring - The path to your texture folder. Textures within must be in the PNG format. -
priorityint - The priority of your texture pack in case of duplicate files. Higher numbers will take priority over lower numbers. -
onSceneGameScene (optional) - Specify that the textures should only be used for this specific scene. This is useful if you want to replace the same texture differently for different game scenes.Valid options are:
MAINMENUSETTINGSCREDITSSPACECENTEREDITORFLIGHTTRACKSTATIONPSYSTEMMISSIONBUILDERLOADINGBUFFER
Note that KSPCommunityFixes entirely removes the
LOADINGBUFFERscene, so replacements scoped to that scene specifically may not work if KSPCF is also installed.
Note
It is recommended to put your textures within a directory named PluginData. This will prevent KSP from loading them into the game
database. Since HUDReplacer loads the textures directly from disk, having them loaded twice would just waste memory.
Let's say we want to replace the texture for the Admin building in the KSC sidebar:
To enable developer features, drop the following ModuleManager patch in a .cfg file somewhere in your GameData directory:
@HUDReplacer {
%showDebugToolbar = true
}Another option is to edit the existing config at GameData/HUDReplacer/Settings.cfg.
Once you have done this, we can go in-game and click the HUDReplacer toolbar icon to enable debug mode. Now we can open the console and press D on the keyboard to log the name of the texture that the mouse is currently over. In this case we should get the result:
Image.mainTexture.name: Buttons_Admin - WxH=256x256
This tells us that the texture for the admin building icon is called Buttons_Admin and that the dimensions of the file is 256x256. Now we can go ahead and create our own texture, or possible just recolor the original texture.
Make sure to save the new texture as Buttons_Admin.png and place it in our folder containing the new textures that we specified in the config file. Now you can hit Q (if in debug mode) or restart the game. You should see that the icon is now our new texture!
If there are multiple versions of the texture that have the same name but different sizes (e.g. rect_round_dark) then you can pick a specific one to override by adding the size to the filename, like this: rect_round_dark#64x64.png. If you don't do this then you may find that the resulting texture scales incorrectly.
Warning
For backwards compatibility reasons, if you have any replacement for a texture (even if the sizes don't match) then HUDReplacer will replace that texture. You can pick which texture it uses by providing multiple different ones with sizes. If none of the sizes match then HUDReplacer will use file without explicit sizes, or, if that doesn't exist, the largest sized texture.
If the texture you care about is only present in a specific scene then you can use onScene to only replace that texture for that
scene. Scene specific overrides are not considered in other scenes.
- Q - Reload all replaced textures.
- E - Dump all textures in the scene to KSP.log.
- D - Dump the textures underneath the mouse to KSP.log.