How to use animation
Moderator: Plugin Moderators
How to use animation
Help me with the windturbine fan how can i add it in json?
Re: Advanced tags for building plugins
How to make the fan of wind turbine rotate?
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
Re: Advanced tags for building plugins
Here's part of the definition for the in-game wind turbine:
The blades:
Code: Select all Reset
[ { "id":"$animationfan00", "type":"animation", "frames":[{"bmp":"blades.png","w":60,"h":58,"count":6}] }, { "id":"$windturbine00", "type":"energy", "width":3, "height":3, "frames":[{"x":1792,"y":1264,"w":96,"h":96}], "animation":[ {"id":"2x2l", "x":67, "y":-2}, // Some light for night mode {"id":"$animationblinkingredlight3x3","x":23,"y":-71}, // A blinking red light for decoration {"id":"$animationfan00","x":7,"y":-94} // Our previously defined blades ], // ... } ]
JSON checker
Re: Advanced tags for building plugins
I have written json like that but it doesn't work. Can you explain why you use w, h in both frame and count in animation?
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
Re: Advanced tags for building plugins
"doesn't work" is not exactly helpful for us to diagnose the issue.
In the animation I specify width and height explictily so that the game knows the size of a single frame. It then uses count to extract that amount of frames. These will then be used to play the animation.
In the animation I specify width and height explictily so that the game knows the size of a single frame. It then uses count to extract that amount of frames. These will then be used to play the animation.
Re: Advanced tags for building plugins
I saw some pluggin didnt use w and h. How do you know w h of a plugin
Re: Advanced tags for building plugins
Oke i have done it. How do you know that is the perfect w and h to display each blades of the blades frame and why the game doesn't display all 6 blades if i use this code.Lobby wrote: ↑04 Aug 2022, 17:49 "doesn't work" is not exactly helpful for us to diagnose the issue.
In the animation I specify width and height explictily so that the game knows the size of a single frame. It then uses count to extract that amount of frames. These will then be used to play the animation.
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
Re: How to use animation
By using w, h you tell the game the size of individual frames of the animation. The game will then try to get count many such frames from the provided image. The game will not calculate w, h automatically for count>1