Prismatic Belts

by Kirazy

Colors the conveyor surface of transport belts to match the arrows, improving visibility. Supports Bob's mods and Artisanal Reskins, Krastorio 2, Ultimate Belts, Factorio Extended Plus and Random Factorio Things and in combination with Miniloader, Loader Redux, Deadlock Stacking Beltboxes & Loaders and Vanilla Loaders.

Tweaks
a month ago
1.1 - 2.0
16.3K

FAQ

Transport Belt Reskin Functions
Prismatic Belts provides an API for use by mod authors looking to manage belts themselves.

To use it, first require it:
`local prismatic_api = require("prismatic-belts.prototypes.api")

get_transport_belt_icon(inputs)

Returns a complete item icons definition

---@type PrismaticBelts.TransportBeltIconInputs
local inputs = {
    use_three_arrow_variant = false,
    base_tint = nil,
    mask_tint = util.color("16f263d1"), -- Green with 82% alpha.
    arrow_tint = nil,
}

local item = data.raw["item"]["transport-belt"]
item.icons = api.get_transport_belt_icon(inputs)

PrismaticBelts.TransportBeltIconInputs

  • use_three_arrow_variant? boolean
    When true, the icon will have three arrows; otherwise, it will have two.
  • base_tint? data.Color
    Color to tint the base sprite (gears, rails)
  • mask_tint? data.Color
    Color to tint the mask sprite (belt surface, arrows)
  • arrow_tint? data.Color
    Color to tint the arrow layer; when nil, the arrow layer will not be included. Suggested alpha value is 0. Use to increase the brightness of the arrows when used with a particularly dark mask_tint.

get_transport_belt_technology_icon(inputs)

Returns a complete technology icons definition

---@type PrismaticBelts.TransportBeltTechnologyIconInputs
local inputs = {
    base_tint = nil,
    mask_tint = util.color("16f263d1"), -- Green with 82% alpha.
    arrow_tint = nil,
}

local technology = data.raw["technology"]["logistics-3"]
technology.icons = api.get_transport_belt_technology_icon(inputs)

PrismaticBelts.TransportBeltTechnologyIconInputs

  • base_tint? data.Color
    Color to tint the base sprite (gears, rails)
  • mask_tint? data.Color
    Color to tint the mask sprite (belt surface, arrows)
  • arrow_tint? data.Color
    Color to tint the arrow layer; when nil, the arrow layer will not be included. Suggested alpha value is 0. Use to increase the brightness of the arrows when used with a particularly dark mask_tint.

get_transport_belt_animation_set(inputs)

Returns a complete TransportBeltAnimationSet definition.

---@type PrismaticBelts.TransportBeltAnimationSetInputs
local inputs = {
    base_tint = nil,
    tint_base_as_overlay = nil,
    mask_tint = util.color("16f263d1"), -- Green with 82% alpha.
    tint_mask_as_overlay = true,
    variant = 2,
    arrow_tint = nil,
}

local entity = data.raw["transport-belt"]["transport-belt"]
entity.belt_animation_set = api.get_transport_belt_animation_set(inputs)

PrismaticBelts.TransportBeltAnimationSetInputs

  • base_tint? data.Color
    Color to tint the base sprite (gears, rails)
  • tint_base_as_overlay? boolean
    When true, the color blending for the base_tint will use Overlay rules.
  • mask_tint? data.Color
    Color to tint the mask sprite (belt surface, arrows)
  • tint_mask_as_overlay? boolean
    When true, the color blending for the mask_tint will use Overlay rules.
  • arrow_tint? data.Color
    Color to tint the arrow layer; when nil, the arrow layer will not be included. The layer is inserted at the top of the stack with additive-soft blending; use to increase the brightness of the arrows when used with a particularly dark mask_tint.
  • variant? 1|2|3
    Spritesheet to return (1 for slow, 2 for fast, 3 for turbo fast [requires Space Age]).

create_remnant(name, inputs)

Reskins, or creates as needed, appropriate transport belt remnants.

---Table of parameters that configure the remnant sprites.
---@type PrismaticBelts.CreateRemnantInputs
local inputs = {
    base_tint = nil,
    tint_base_as_overlay = nil,
    mask_tint = util.color("16f263d1"), -- Green with 82% alpha.
    tint_mask_as_overlay = true,
    variant = 2,
    arrow_tint = nil,
}

local entity = data.raw["transport-belt"]["transport-belt"]
api.create_remnant(entity.name, inputs)

PrismaticBelts.CreateRemnantInputs

  • base_tint? data.Color
    Color to tint the base sprite (gears, rails)
  • tint_base_as_overlay? boolean
    When true, the color blending for the base_tint will use Overlay rules.
  • mask_tint? data.Color
    Color to tint the mask sprite (belt surface, arrows)
  • tint_mask_as_overlay? boolean
    When true, the color blending for the mask_tint will use Overlay rules.
  • arrow_tint? data.Color
    Color to tint the arrow layer; when nil, the arrow layer will not be included. The layer is inserted at the top of the stack with additive-soft blending; use to increase the brightness of the arrows when used with a particularly dark mask_tint.
  • variant? 1|2|3
    Spritesheet to return (1 for slow, 2 for fast, 3 for turbo fast [requires Space Age]).

get_transport_belt_frozen_patch(variant)

Gets the transport belt frozen_patch RotatedSprite for the given variant. If Space Age is not active, returns nil.

local entity = data.raw["transport-belt"]["transport-belt"]
entity.belt_animation_set.frozen_patch = api.get_transport_belt_frozen_patch(1)
  • variant 1|2|3
    Spritesheet to return (1 for slow, 2 for fast, 3 for turbo fast [requires Space Age]).