-
Notifications
You must be signed in to change notification settings - Fork 0
[LooksCrafter] Home
Welcome to the LooksCrafter documentation
LooksCrafter is a useful tool for configuring a modular wardrobe, allowing you to think about which wardrobe elements to add, not how to add them.
The first thing to understand about how LooksCrafter works with you wardrobe is its structure.
The first step to getting started with LooksCrafter is to obtain its API - the top element of the structure.
local looksAPI = require("your/path/to/LooksCrafter.lua")The next thing worth talking is about handlers. Each handler is tied to a "base texture" and handles layers of textures merged to this base texture. Each base texture can have only one handler.
-- Creates a handler for the texture located at assets/Skin.png
local skinHandler = looksAPI:newHandler(textures["assets.Skin"])In each handler, you can create slots into which clothing items will be placed. Each slot has its own priority, which determines the order in which layers are applied. The lower the priority number, the first piece of clothing placed in the slot will be applied to the base texture. Two slots cannot have the same priority.
-- Creates a slot for boots-like items; Priority = 1; No default item.
skinHandler:newSlot("Boots", 1, false, {
goofyClownBoots = {
texture = textures["assets.Boots.goofyClownBoots.png"]
},
whiteSneakers = {
texture = texture["assets.Boots.whiteSneakers.png"]
}
})
-- Creates a slot for bottom items;
-- Priority = 2(Will be merged with the base texture after boots-like item);
-- Shorts as a default item.
skinHandler:newSlot("Bottom", 2, "Shorts", {
Jeans = {
texture = textures["assets.Bottom.Jeans.png"]
},
Shorts = {
texture = texture["assets.Bottom.Shorts.png"]
},
BlueTrousers = {
texture = texture["assets.Bottom.BlueTrousers.png"]
}
})Items are the lowest part of the structure. Each item can include a texture that will be merged with the base texture when the item is equipped. A model parts table whose visibility will be changed when the item is equipped. onEquip and onUnequip are functions that will be executed when the item is equipped or unequipped.
LooksCrafter API
- Handler 1
-
- Boots slot
-
-
- Goofy clown boots
-
-
-
- White sneakers
-
-
-
- Blue sneakers
-
-
- Shirts slot
-
-
- Green T-shirt
-
-
-
- Powdery shirt
-
-
- Hats slot
-
-
- Cyan Bandana
-
-
-
- Magenta Bandana
-
-
-
- Brown Fedora
-