
As you can see, cars aren't visible behind the borders. If you provide that borders directly to the road texture, cars would just ride over it, but, not now.
It became possible because of existing of animation fg feature.
REQUIREMENTS
For that borders, you should provide them as a animation. For our case, we need just two of them:
TEXTURE
The background is directly applied to the road frames:
JSON
The important part is to figure out for which frames which animation has to be shown. Here a sketch where the needed fg animations are marked:
And then some of magic in our code:

Code: Select all
[
{
"id":"$anim_road_bordered00_left00",
"type":"animation",
"frames":[{"bmp":"border_fg_left.png","handle y":8}]
},
{
"id":"$anim_road_bordered00_right00",
"type":"animation",
"frames":[{"bmp":"border_fg_right.png","handle y":8}]
},
{
"id":"$road_bordered00",
"type":"road",
"level":2,
"frames":[{"bmp":"frames.png","w":32,"count":16}],
"animation fg":[
{"id":"$anim_road_bordered00_left00"},
{"id":"$anim_road_bordered00_right00"}
],
"frame animation fg indices":[
[0,1],
[0],
[0,1],
[0],
[0,1],
[0],
[0,1],
[0],
[1],
[],
[1],
[],
[1],
[],
[1],
[]
]
}
]
Code: Select all
"frame animation fg indices":[
[0,1], // Show 0th and 1th animation for first frame, that means left & right border
[0], // Show only left border for second frame
[0,1], // Show left & right borders for third frame
[0], // Show only left border for fourth frame
[0,1], // Show left & right ...
[0], // Show only left
[0,1], // Show left & right
[0], // Show only left
[1], // Show right
[], // No front border
[1], // Show right
[], // No front border
[1], // Show only left
[], // No front border
[1], // Show only left
[] // No front border
]
Big thanks to @Lobby for texture, text and realisation of this feature itself.