Page 1 of 1

adjusting image to collision box

Posted: Wed Aug 17, 2016 2:42 pm
by keneda83
Hello guys i'm trying to make my own picture for a building but i'm having pain to adjust the pics to the collision box does anyone can explain how the picture is loaded and how it work with the collision box? thanks in advance for any help!

Re: adjusting image to collision box

Posted: Wed Aug 17, 2016 6:44 pm
by aubergine18
There's three settings - collision_box (footprint of the entity on the ground), drawing_box (actual size of the entity) and selection_box (where the selector lines will be drawn if player hovers/clicks entity).

Each has an area object - { {left,top}, {right,bottom} } where those values are offsets from the centre of your object (as far as I can tell). A map tile is 32px square, so a value of 1 will represent 1 tile. If your entity is 1x1 footprint, then the collision box would be something like { {-0.5,-0.5}, {0.5, 0.5} } (I think?!)

For more infos, see https://wiki.factorio.com/index.php?tit ... ype/Entity

Re: adjusting image to collision box

Posted: Wed Aug 17, 2016 6:52 pm
by keneda83
thanks you very much for replying me, i think i got what you mean , and ty for the link i think i gonna help me alot!

Re: adjusting image to collision box

Posted: Wed Aug 17, 2016 6:56 pm
by aubergine18
In game, if you press F4 you get a debug panel appearing - there are two options that will help:

Image

It draws the actual boxes so you can see exactly where they are:

Image

Re: adjusting image to collision box

Posted: Wed Aug 17, 2016 7:54 pm
by keneda83
thanks you very much for this great tips , but it don't help my problem with my grafics maybe a screenshot can help understand

So, basicly i want to adjust the bottom left right of my building with the collision/selection box and allow the picture to be fully displayed, i tried to play with the drawing box but no luck.

Re: adjusting image to collision box

Posted: Wed Aug 17, 2016 8:08 pm
by Arch666Angel
First off: Your sprite is way bigger than your collisionbox, so you should adjust that via collision_box and selection_box, the collision_box should be a tad smaller than the selection_box.

If you want to move the sprite relative to the collision_box you need to use the shift value specified with the sprite.

Re: adjusting image to collision box

Posted: Wed Aug 17, 2016 8:33 pm
by keneda83
ok thanks you very much for these info i will try to play with those shift option (how does it work exactly? , it just have X and Y right? and it appliy from the center of the entity?) and probably reqize my picture

Re: adjusting image to collision box

Posted: Wed Aug 17, 2016 10:30 pm
by Arch666Angel
the game renders from left to right and from top to bottom, so the y axis is inverted (+ down, - up)

Re: adjusting image to collision box

Posted: Wed Aug 17, 2016 10:38 pm
by Nexela
Arch666Angel wrote:the game renders from left to right and from top to bottom, so the y axis is inverted (+ down, - up)
....Really wish I knew this earlier.......

Re: adjusting image to collision box

Posted: Thu Aug 18, 2016 1:14 pm
by keneda83
thanks evryone for this help i managed to make something better