Texture Atlas - Terasology/TutorialAssetSystem GitHub Wiki
A texture atlas is a larger texture, which is split by a given grid in smaller icons.
As the name says, textures are defined at assets/textures
with the .png
extension and an atlas is defined at assets/atlas
as textfile with .atlas
extension.
Example
Following is an example from the module ManualLabor :
ManualLabor.png
ManualLabor.atlas
{
"texture":"ManualLabor",
"textureSize":[256, 256],
"grid":{
"tileSize":[32, 32],
"gridDimensions":[8, 8],
"tileNames":[
"ShovelHead", "PickaxeHead", "AxeHead", "SledgeHammerHead", "", "", "Time", "Heat",
"MetalFileHandle", "ScrewdriverHandle", "Wrench", "SawHandle", "PliersHandle", "MagnifyingGlass", "", "",
"MetalFileHead", "ScrewdriverHead", "Key", "SawHead", "PliersHead", "MalletHead", "", "",
"CrudeHammer", "CrudeAxe", "Cloth", "String", "CrudeShovel", "MalletHandle", "", "",
"Stick", "Plank", "Pegs", "WoolVest", "ArabicThawb", "Waterskin", "WaterskinEmpty", "",
"PlantMatter", "WoodenBucket", "WoodenBucketFluid", "WoodenCup", "WoodenCupFluid", "", "WoodenShoe", "",
"", "SmallChunks", "SmallDust", "", "", "", "", "",
"Nugget", "Chunks", "Dust", "Sheet", "Plate", "Rod", "Bolt", "Screw"
]
}
}
So the prefab for a key
in ManualLabor would be as follows :
{
"parent": "engine:iconItem",
"Item": {
"icon": "ManualLabor:ManualLabor#Key",
"stackId": "ManualLabor:Key"
},
"DisplayName": {
"name": "Key"
},
"MaterialItem": {
"icon": "ManualLabor:ManualLabor#Key"
}
}
The key then uses the texture mentioned in the atlas with the #
symbol ; "icon": "ManualLabor:ManualLabor#Key"