The ACTUAL tutorial on custom animations

Learn here how to create and use plugins.

Moderators: FranchuFranchu, Bearbear65

Post Reply
User avatar
FranchuFranchu
Inhabitant of a Megalopolis
Reactions:
Posts: 620
Joined: Sun May 28, 2017 0:07
Location: Patch of air
Plugins: Show
Version: Beta

The ACTUAL tutorial on custom animations

Post by FranchuFranchu » Sun Jun 17, 2018 22:22

Since KoalaGuy was deleted, all his posts are gone. One of those posts was about custom animations. So here I am remaking the tutorial

To define your animation:

Code: Select all

[
   {
       "id":"myanimation",
       "frames":[ {
              "bmp":"myanim.png"
              "move x":5 //In moment number 1, 
             //our animation will be in x 5
             "move y":16 //and in y 16
           },{
              "bmp":"myanim.png"
              "move x":10 //In moment number 2, 
             //our animation will be in x 10
             "move y":16 //and in y 16
           }
           
         ]
         "handle interpolation":5 //5 ticks between
         //moment 1 and moment 2
     }
]
To use it:

Code: Select all

[ 
  {
    "id":"buildingwithanimation",
    "type":"decoration",
    "width":1,
    "height":1,
    "frames":[{"bmp":"basepart.png"}],
    "animation":[
      {"id":"myanimation"}
    ]
  }
 ]
I hope I didn't mess up with anything

Code: Select all

del self
...

User avatar
dom.stephen
Small-town resident
Reactions:
Posts: 31
Joined: Sun Jul 30, 2017 1:57
Location: GMT+8:00
Plugins: Show
Version: Beta

Re: The ACTUAL tutorial on custom animations

Post by dom.stephen » Sun Jun 24, 2018 15:30

How is x and y defined?
Tempora bona veniat,
Pax Christi veniat,
Regnum Christi veniat.

User avatar
FranchuFranchu
Inhabitant of a Megalopolis
Reactions:
Posts: 620
Joined: Sun May 28, 2017 0:07
Location: Patch of air
Plugins: Show
Version: Beta

Re: The ACTUAL tutorial on custom animations

Post by FranchuFranchu » Sun Jun 24, 2018 16:34

You mean "move x" and "move y" or "x" and "y"?

Code: Select all

del self
...

User avatar
dom.stephen
Small-town resident
Reactions:
Posts: 31
Joined: Sun Jul 30, 2017 1:57
Location: GMT+8:00
Plugins: Show
Version: Beta

Re: The ACTUAL tutorial on custom animations

Post by dom.stephen » Sun Jun 24, 2018 16:48

Both? I'm clueless to animations :calc
Tempora bona veniat,
Pax Christi veniat,
Regnum Christi veniat.

User avatar
FranchuFranchu
Inhabitant of a Megalopolis
Reactions:
Posts: 620
Joined: Sun May 28, 2017 0:07
Location: Patch of air
Plugins: Show
Version: Beta

Re: The ACTUAL tutorial on custom animations

Post by FranchuFranchu » Sun Jun 24, 2018 21:58

"x" and "y" select a certain part of a image. For example

Code: Select all

"frames":[{
"bmp":"file.png",
"x": 20,
"y":40,
"w": 30,
"h":50
}]
will use a 30×50 rectangle starting at point 20,40 of file.png and set it as the building's frame. You don't to use them in animations. You can use them in any building

"move x" and "move y" are for animations. They set the position of the animation in a specific moment

In the first example of this topic, I made the animation go from (5,16) to (10,16)

Code: Select all

del self
...

Post Reply

Return to “Tutorials and Documentation”

Who is online

Users browsing this forum: No registered users and 1 guest