Skip to content
Bannerlord Wiki
Share
Explore
Tutorials

Loading Spite Data

Loading Sprite Data

Module/GUI/ModuleSpriteData.xml

Instantiate Game Objects in Class

UIResourceManager.UIResourceDepot
UIResourceManager.ResourceContext
UIResrouceManager.SpriteData

Capture Sprite Data

SpriteData spirteData = new SpriteData("XmlSpriteData");
spriteData.load(UIResourceManager.UIResourceDepot);

Loading Textures

Filepath

Code

Texture texture = new Texture(new EngineTexture(Texture.CreateTextureFromPath("../../Modules/Entrepreneur/GUI/SpriteSheets/", "entrepreneur-ui-1.png")));

Loading Sprite Category

XML

Code

SpriteData sd = UIResourceManager.SpriteData;
SpriteData spriteData = new SpriteData("EntrepreneurSpriteData");
sd.SpriteCategories.Add("entrepreneur_icons", spriteData.SpriteCategories["entrepreneur_icons"]);

Loading SpritePartName

XML

Code

SpriteData sd = UIResourceManager.SpriteData;
SpriteData spriteData = new SpriteData("EntrepreneurSpriteData");
sd.SpritePartNames.Add("FinancesIcon", spriteData.SpritePartNames["FinancesIcon"]);

Loading SpirteNames

???

Code

sd.SpriteNames.Add("Entrepreneur.EmptyField", new SpriteGeneric("Entrepreneur.EmptyField", spriteData.SpritePartNames["Entrepreneur.EmptyField"]));
SpriteCategory bettertimeicons = sd.SpriteCategories["entrepreneur_icons"];
bettertimeicons.SpriteSheets.Add(texture);
bettertimeicons.Load(rc, rd);
UIResourceManager.BrushFactory.Initialize();
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.