The current implementation of scrolling isn't very compatible with draw layers that depend on the position of game entities. The primary example of this is target_overlay, which only updates the positions of the targeting lines after the scrolling has finished. That's because the screen-space coordinates that target_overlay's draw layer calculates are based on the tile-space coordinates of the entity only, without the scrolling offset added.
We might have to expose IMapObject:get_screen_pos() or similar, which adds together the tile-to-screen, offset, and scrolling offset of the entity to get a final screen-space coordinate for that entity. The difference between the three is:
Tile-to-screen: entity's world position in tile space converted to screen space.
Offset: extra screen-space offset to apply to the entity, for cosmetic purposes. This is intended to be changed by mods.
Scroll offset: offset used for scrolling entities when screen scrolling is enabled. This is not intended to be changed by mods.
The scroll offset is not currently a property contained on map objects; it is internal to the batching indices inside the chip rendering layer at a lower level. This change would mean exposing it at a higher level somehow, so mods can always calculate the exact screen-space position of an entity after all offsets are added.
The current implementation of scrolling isn't very compatible with draw layers that depend on the position of game entities. The primary example of this is
target_overlay
, which only updates the positions of the targeting lines after the scrolling has finished. That's because the screen-space coordinates thattarget_overlay
's draw layer calculates are based on the tile-space coordinates of the entity only, without the scrolling offset added.We might have to expose
IMapObject:get_screen_pos()
or similar, which adds together the tile-to-screen, offset, and scrolling offset of the entity to get a final screen-space coordinate for that entity. The difference between the three is:The scroll offset is not currently a property contained on map objects; it is internal to the batching indices inside the chip rendering layer at a lower level. This change would mean exposing it at a higher level somehow, so mods can always calculate the exact screen-space position of an entity after all offsets are added.