How can I move the selection box of this entity?

Place to get help with not working mods / modding interface.
Post Reply
YoloJoe
Inserter
Inserter
Posts: 34
Joined: Wed Apr 13, 2016 2:56 pm
Contact:

How can I move the selection box of this entity?

Post by YoloJoe »

Image

I want to move the selection box to fit over my machine, whatever I do with the

Code: Select all

selection_box = {{-4.2, -0.6}, {2, 2.35}},
values the box just seem to get bigger or smaller, how can I simply move it a bit to the right?

MrDoomah
Fast Inserter
Fast Inserter
Posts: 196
Joined: Mon Jun 01, 2015 1:11 pm
Contact:

Re: How can I move the selection box of this entity?

Post by MrDoomah »

selection_box = {{-4.2, -0.6}, {2, 2.35}},
The selection box is an area around the entity position. The entity sits at position {0,0} and the selection box is then:

Code: Select all

    selection_box = {{Left border, Top border}, {Right border, Bottom border}},
and translates to

Code: Select all

    selection_box = {{ - Width / 2, - Height / 2 }, { Width / 2, Height / 2 }},
To move this, you just change the selection box with an offset:

Code: Select all

    selection_box = {{ (- Width / 2) + offset, - Height / 2 }, { (Width / 2) + offset, Height / 2 }},
Please note that the left and top border must be smaller or equal to 0 and the right and bottom border must be greater or equal to 0.

User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: How can I move the selection box of this entity?

Post by Arch666Angel »

To be honest, it might be easier to just shift your animation/picture to the left side.

Post Reply

Return to “Modding help”