## Animations: Determining coordinates?

Plug-in related stuff can be discussed here.

Moderator: Plugin Moderators

mdk_813
Inhabitant of a Country
Reactions:
Posts: 850
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

### Animations: Determining coordinates?

So, after Lobby's information on blinking lights (see here: viewtopic.php?p=49384#p49384 )
I decided to make a test plugin with a small blinking light made by myself. It is basically a small 1x1 boie with draw ground that builds on water.
After some trial and error I was able to determine that in this case, the coordinates must be "x":14,"y":-9. However, I cannot figure out the system behind it. Why does the game want these coordinates? Because they differ from what I've counted out by using the method provided here: viewtopic.php?f=41&t=1215

How do I determine the pivot point from where to count pixels? Is it a different point, if there is no ground texture?

The json looks like this (it works as intended):

Code: Select all

[
{
"id":"TestbojeNEU.mdk_813",
"type":"decoration",
"author":"mdk_813",
"width":1,
"height":1,
"frames":[{"bmp":"TestbojeNEU_1x1.png"}],
"animation":[{"id":"MyRedLight_5x5.mdk_813","x":14,"y":-9}],
"price":1,
"monthly price":1,
"draw ground":true,
"water":"0",
"power":"0",
"build time":0,
"needs water":true,
"needs land":false,
"title":"TestbojeNEU",
}
]
This is an enlarged image to illustrate how I intially counted (the yellow pixel is where the animation should be):
TestbojeNEU_1x1_Coordinates.png (3.31 KiB) Viewed 889 times

This is the original plugin png.
TestbojeNEU_1x1.png (2.85 KiB) Viewed 889 times

This is the complete plugin:
TestbojeNEU.zip

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

CommanderABab
Inhabitant of a Multiverse
Reactions:
Posts: 6707
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

### Re: Animations: Determining coordinates?

I think the house smoke is a 1x1 or 3x3 animation. Since yours is 5x5, the x and y values are going to be smaller by the difference in the sizes to get it centered the same on the same point.
547🆎️

mdk_813
Inhabitant of a Country
Reactions:
Posts: 850
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

### Re: Animations: Determining coordinates?

CommanderABab wrote:
Wed Aug 23, 2017 0:33
I think the house smoke is a 1x1 or 3x3 animation. Since yours is 5x5, the x and y values are going to be smaller by the difference in the sizes to get it centered the same on the same point.
Thanks, that might be the explanation.
However, wouldn't you expect the same differences for the x- and the y-coordinate then, between what I have expected and what I actually needed to set? After all the size of my animation is proportional to the size of the ingame animation.
It it strange really. Maybe I overlook something, but it seems like finding the coordinates is merely a guessing game, and I'm quite sure, it shouldn't be.

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

CommanderABab
Inhabitant of a Multiverse
Reactions:
Posts: 6707
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

### Re: Animations: Determining coordinates?

Try centering animations of the same image at different sizes within a 32x32 then using handle x and handle y then . Then doing that, but making it appear as a pyramid.
547🆎️

mdk_813
Inhabitant of a Country
Reactions:
Posts: 850
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

### Re: Animations: Determining coordinates?

Thank you, I'll try that.

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

rjroldan1
Inhabitant of a Conurbation
Reactions:
Posts: 473
Joined: Mon Jul 17, 2017 16:16
Location: philippines
Plugins: Show
Version: Beta
Contact:

### Re: Animations: Determining coordinates?

are you making firecracker fountain?
Silent

President of Metropole region

____________________________________________________________________________________
I LOVE PHILIPPINES

Lobby
Developer
Reactions:
Posts: 3170
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

### Re: Animations: Determining coordinates?

coord.png (1.4 KiB) Viewed 796 times
It's exactly as @CommanderABab said. It might be confusing though because of the use coordinate system.
...

mdk_813
Inhabitant of a Country
Reactions:
Posts: 850
Joined: Fri Dec 16, 2016 2:38
Location: Germany
Plugins: Show

### Re: Animations: Determining coordinates?

@Lobby
Thank you for the clarification.

After looking at your example, I think what's making it confusing is that the coordinates are determined in reference to the upper-left corner of the animation.
So in this case here, you would have to count to the near edge of the animation to get the x-value, while for the y-value you would have to count to the far edge of the animation. This is probably not what you would expect by intuition.

PLEASE NOTE: My plugins are not open source! So, ask me first before altering and republishing any of my plugins!

Lobby
Developer
Reactions:
Posts: 3170
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

### Re: Animations: Determining coordinates?

The handle is by default always in the upper left corner except for building frames (and road frames). It's a good practice to move the handle to a meaningful position for animations using "handle x" and "handle y" (for example to the center).

I have to admit that I didn't always follow this myself. For example the pre-defined animations use the default handle.
...

### Who is online

Users browsing this forum: No registered users and 2 guests

﻿