1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Clarified animations format

This commit is contained in:
Ivan Savenko 2023-09-26 16:00:33 +03:00
parent 0ab766479d
commit 67a98d086f

View File

@ -34,7 +34,7 @@ VCMI allows overriding HoMM3 .def files with .json replacement. Compared to .def
...
],
// Allow overriding individual frames in file
// Alternative to "sequences". Allow overriding individual frames in file. Generally should not be used in the same time as "sequences"
"images" :
[
{
@ -58,10 +58,10 @@ VCMI allows overriding HoMM3 .def files with .json replacement. Compared to .def
## Replacing a button
This json file will allow replacing .def file for a button with png images. Buttons require following images:
0. Active state. Button is active and can be pressed by player
1. Pressed state. Player pressed button but have not released it yet
2. Blocked state. Button is blocked and can not be interacted with. Note that some buttons are never blocked and can be used without this image
3. Highlighted state. This state is used by only some buttons and only in some cases. For example, in main menu buttons will appear highlighted when mouse cursor is on top of the image. Another example is buttons that can be selected, such as settings that can be toggled on or off
1. Active state. Button is active and can be pressed by player
2. Pressed state. Player pressed button but have not released it yet
3. Blocked state. Button is blocked and can not be interacted with. Note that some buttons are never blocked and can be used without this image
4. Highlighted state. This state is used by only some buttons and only in some cases. For example, in main menu buttons will appear highlighted when mouse cursor is on top of the image. Another example is buttons that can be selected, such as settings that can be toggled on or off
```javascript
"basepath" : "interface/MyButton", // all images are located in this directory
@ -76,6 +76,30 @@ This json file will allow replacing .def file for a button with png images. Butt
}
```
## Replacing simple animation
This json file allows defining one animation sequence, for example for adventure map objects or for town buildings.
```javascript
"basepath" : "myTown/myBuilding", // all images are located in this directory
"sequences" :
[
{
"group" : 0,
"frames" : [
"frame01.png",
"frame02.png",
"frame03.png",
"frame04.png",
"frame05.png"
...
]
}
]
}
```
## Replacing creature animation
TODO