adjusting image to collision box
adjusting image to collision box
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!
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: adjusting image to collision box
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
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
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: adjusting image to collision box
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!
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: adjusting image to collision box
In game, if you press F4 you get a debug panel appearing - there are two options that will help:
It draws the actual boxes so you can see exactly where they are:
It draws the actual boxes so you can see exactly where they are:
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: adjusting image to collision box
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.
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.
- Attachments
-
- building.png (605.22 KiB) Viewed 3514 times
- Arch666Angel
- Smart Inserter
- Posts: 1636
- Joined: Sun Oct 18, 2015 11:52 am
- Contact:
Re: adjusting image to collision box
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.
If you want to move the sprite relative to the collision_box you need to use the shift value specified with the sprite.
Angels Mods
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
Re: adjusting image to collision box
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
- Arch666Angel
- Smart Inserter
- Posts: 1636
- Joined: Sun Oct 18, 2015 11:52 am
- Contact:
Re: adjusting image to collision box
the game renders from left to right and from top to bottom, so the y axis is inverted (+ down, - up)
Angels Mods
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ
"should be fixed"
Re: adjusting image to collision box
....Really wish I knew this earlier.......Arch666Angel wrote: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
thanks evryone for this help i managed to make something better