Author Topic: Precise positionning of doodads  (Read 5969 times)

Ilmion

  • Posts: 6
  • Maggot Crusher.
    • View Profile
Precise positionning of doodads
« on: March 25, 2015, 02:42:40 AM »
I'm making a custom doodad similar to exit_teleport_boss_desert, so I'll use it has an example. I want to put my custom lock on it (which are the same size has the normal one. ie : boss_lock.png)
When I want to align the lock on the exit_teleport_boss_desert doodad, some lock do not align. Even at 1/8 grid size and at this point unchecking doesn't seem to let me move the lock doodad more freely.

I experimented a little and quickly found out that one "pixel" had a 0.125 increment in the vector positioning in the level xml. And has a matter of fact, when I change the position manually in the level xml, I can get the lock doodad in the right position. Which give something like : <vec2 name="pos">-9.9375 31.1875</vec2>

Here is the question (my first one here and my forst post) : Is the a better way to do it ? A way that would be in the editor ? Because if I move the doodad by accident in the editor, I have to move it manually again. It is not a big pain to do it manually because for now I only have this one case, but I'm curious.

Thanks

Hipshot

  • Developer
  • Posts: 455
  • Level Designer
    • View Profile
Re: Precise positionning of doodads
« Reply #1 on: March 25, 2015, 06:40:32 AM »
What does the sprite look like? You should not have to align anything in the xml, editor should be enough.

Ilmion

  • Posts: 6
  • Maggot Crusher.
    • View Profile
Re: Precise positionning of doodads
« Reply #2 on: March 25, 2015, 10:40:46 AM »
I have the same problem using the exit_teleport_boss_desert sprite and the boss_lock_1_small sprite.
In the attached image, example.png, you can see on the left the positioning I get with the editor. In which I am not able to put the lock completely in the yellowish circle. On the left, the positioning I want to achieve.

I have also attached my sprite which is basically a reskin of sort of the exit_teleport_boss_desert. The A are the place where I put the small lock doodad over.
The xml definition is a copy and paste of the exit_teleport_boss_desert one.

Edit : For the sake of putting everything here, I have also attached my lock sprite. They are made to spell"Alexandre" which is the name of my kid for whom I am making this little campaign and by the way learning my way around the map editing.
« Last Edit: March 25, 2015, 10:43:32 AM by Ilmion »

Hipshot

  • Developer
  • Posts: 455
  • Level Designer
    • View Profile
Re: Precise positionning of doodads
« Reply #3 on: March 25, 2015, 01:22:50 PM »
Ah ok, well, change the origin of the sprite with "1" vertical, positive or negative and it should work. It's because the smallest step in the editor is not 1 pixel, it's 2 =)
« Last Edit: March 25, 2015, 04:59:33 PM by Hipshot »

Hipshot

  • Developer
  • Posts: 455
  • Level Designer
    • View Profile
Re: Precise positionning of doodads
« Reply #4 on: March 25, 2015, 01:23:15 PM »
You can see the grid by pressing "0" in the editor and change the grid values with 1-9.

Ilmion

  • Posts: 6
  • Maggot Crusher.
    • View Profile
Re: Precise positionning of doodads
« Reply #5 on: March 25, 2015, 07:29:50 PM »
Thank you, that did the trick.