kts.SetOverlayOffsets – set x,y offsets for Overlay graphics
kts.SetOverlayOffsets(params)
where params
is a list of 60 parameters as described below.
When an item Overlay is drawn on top of a creature, the overlay graphic is not displayed at the exact same (x,y) pixel coordinates as the creature; instead it is offset by a certain amount in both x and y. This function sets those offsets.
The parameters are divided into five groups of 12 parameters each. The first group corresponds to a "normal" creature (e.g. a knight just walking along normally), the second group corresponds to "melee backswing" (used when a knight is holding back the sword or other weapon, ready to strike), the third group corresponds to "melee downswing" (used after a knight has struck), the fourth group corresponds to "parrying" (used when a knight parries a blow), and the fifth group corresponds to "throwing backswing" (used when a knight is about to throw a missile weapon e.g. an axe).
Each group is itself subdivided into four "triples" of parameters. Each "triple" consists of a direction name ("north", "south", "east" or "west"), an x offset (in units of 1/1000th of the dungeon square size), and a y offset (again in units of 1/1000th of a square).
None.
Errors may be raised if the number of types of parameters are not correct.
Most users will not need to care about this function. The necessary kts.SetOverlayOffsets
call has already been provided in graphics.lua
, and it should not be necessary to change this in any way. In fact, doing so might break the animations for the existing creatures and weapons, so caution is advised.
The overlay offsets cannot be changed per-Anim; instead only one "global" set of offsets (used for all Anims and Overlays) can be set.
The default settings, found in graphics.lua
, are as follows:
kts.SetOverlayOffsets( -- Normal "west", -250, -188, "north", 188, -250, "east", 250, 188, "south", -188, 250, -- Melee backswing "south", 188, 625, "west", -625, 188, "north", -188, -625, "east", 625, -188, -- Melee downswing "north", 0, -1000, "east", 1000, 0, "south", 0, 1000, "west", -1000, 0, -- Parry "west", -250, -125, "north", 125, -250, "east", 250, 125, "south", -125, 250, -- Throwing backswing "south", 188, 625, "west", -625, 188, "north", -188, -625, "east", 625, -188 )