Factorio Prototype DocsVersion 2.0.26

Sprite4Way :: struct or SpriteExample code

Sprites for the 4 major directions of the entity. If this is loaded as a single Sprite, it applies to all directions.

This struct is either loaded as sheets or sheet or a map of one sprite per direction. For per direction sprites, the sprites are loaded via north, east, south and west.

Properties

sheets optional :: array[SpriteNWaySheet]
sheet optional :: SpriteNWaySheet

Only loaded if sheets is not defined.

Only loaded if sheets is not defined.

north optional :: Sprite

Only loaded if both sheets and sheet are not defined.

Only loaded if both sheets and sheet are not defined.

east optional :: Sprite

Only loaded, and mandatory if both sheets and sheet are not defined. [...]

Only loaded, and mandatory if both sheets and sheet are not defined. [...]

south optional :: Sprite

Only loaded, and mandatory if both sheets and sheet are not defined. [...]

Only loaded, and mandatory if both sheets and sheet are not defined. [...]

west optional :: Sprite

Only loaded, and mandatory if both sheets and sheet are not defined. [...]

Only loaded, and mandatory if both sheets and sheet are not defined. [...]

Properties

sheets :: array[SpriteNWaySheet] optional

sheet :: SpriteNWaySheet optional

Only loaded if sheets is not defined.

north :: Sprite optional

Only loaded if both sheets and sheet are not defined.

east :: Sprite optional

Only loaded, and mandatory if both sheets and sheet are not defined.

Only loaded if north is defined.

south :: Sprite optional

Only loaded, and mandatory if both sheets and sheet are not defined.

Only loaded if north is defined.

west :: Sprite optional

Only loaded, and mandatory if both sheets and sheet are not defined.

Only loaded if north is defined.

Example

-- separate sprites per direction
{
  north =
  {
    filename = "__base__/graphics/entity/assembling-machine-3/assembling-machine-3-pipe-N.png",
    priority = "extra-high",
    width = 71,
    height = 38,
    shift = util.by_pixel(2.25, 13.5),
    scale = 0.5
  },
  east =
  {
    filename = "__base__/graphics/entity/assembling-machine-3/assembling-machine-3-pipe-E.png",
    priority = "extra-high",
    width = 42,
    height = 76,
    shift = util.by_pixel(-24.5, 1),
    scale = 0.5
  },
  south =
  {
    filename = "__base__/graphics/entity/assembling-machine-3/assembling-machine-3-pipe-S.png",
    priority = "extra-high",
    width = 88,
    height = 61,
    shift = util.by_pixel(0, -31.25),
    scale = 0.5
  },
  west =
  {
    filename = "__base__/graphics/entity/assembling-machine-3/assembling-machine-3-pipe-W.png",
    priority = "extra-high",
    width = 39,
    height = 73,
    shift = util.by_pixel(25.75, 1.25),
    scale = 0.5
  }
}

Type used in

Prototypes

Types

Defines