Page 1 of 1
[0.12.19] Upper right corner entity display shifted out
Posted: Thu Dec 03, 2015 10:42 am
by Klonan
So i have a large sprite which is shifted in my mod, and in the upper right corner image of it when you mouse over it, the sprite isnt shifted correctly to fill the space given
Only a minor issue, but has been bugging me for a while
Or maybe the issue is that it IS shifted, but shifted outside of the box...
Re: [0.12.19] Upper right corner entity display shifted out
Posted: Thu Dec 03, 2015 10:53 am
by kovarex
This is solvable by setting the drawing_box of the entity.
It is defined in similar way as selection_box or bounding_box, it just specifies the area that should be taken for this preview.
But you reminded me, that I need to fix this value for several vanila objects.
Re: [0.12.19] Upper right corner entity display shifted out
Posted: Thu Dec 03, 2015 1:10 pm
by Klonan
kovarex wrote:This is solvable by setting the drawing_box of the entity.
It is defined in similar way as selection_box or bounding_box, it just specifies the area that should be taken for this preview.
This worked perfectly, almost, seems the sprite is too big for the box area
I've tried increasing and decreasing the drawing box and changing around the numbers, but i can never get it to fit just right, is there a way to scale the drawing box or something?
kovarex wrote:But you reminded me, that I need to fix this value for several vanila objects.
Always happy to help
EDIT: As aside note, the drawing_box isn't mentions in the LuaEntityPrototype doc in the new documentation
Re: [0.12.19] Upper right corner entity display shifted out
Posted: Thu Dec 03, 2015 1:23 pm
by kovarex
It is here:
https://forums.factorio.com/wiki/inde ... rawing_box
If the top part is out of the picture, just decrease the first y1 in {{x1, y1}, {x2, y2}}
Re: [0.12.19] Upper right corner entity display shifted out
Posted: Thu Dec 03, 2015 1:30 pm
by daniel34
Klonan wrote:EDIT: As aside note, the drawing_box isn't mentions in the LuaEntityPrototype doc in the new documentation
It is not listed in doc-html/LuaEntityPrototype.html, the new folder that has been added with 0.12.18.
Re: [0.12.19] Upper right corner entity display shifted out
Posted: Thu Dec 03, 2015 1:32 pm
by kovarex
daniel34 wrote:Klonan wrote:EDIT: As aside note, the drawing_box isn't mentions in the LuaEntityPrototype doc in the new documentation
It is not listed in Factorio/doc-html/LuaEntityPrototype.html, the new folder that has been added with 0.12.18.
Yes, but LuaEntityPrototype and prototype definition are two different things (although related).
The LuaEntityPrototype is in-game read only interface to get info about the prototype from the script.
The EntityPrototypeDefinition is the specification of the entity, of how should it be created in the mod/vanilla lua data files.
Re: [0.12.19] Upper right corner entity display shifted out
Posted: Thu Dec 03, 2015 1:40 pm
by Klonan
kovarex wrote:
If the top part is out of the picture, just decrease the first y1 in {{x1, y1}, {x2, y2}}
Ahh right, for some reason it seemed like it wasn't working when i tried that, but i just set it again and its working properly now, thanks
Re: [0.12.19] Upper right corner entity display shifted out
Posted: Thu Dec 03, 2015 4:46 pm
by Rseding91
kovarex wrote:daniel34 wrote:Klonan wrote:EDIT: As aside note, the drawing_box isn't mentions in the LuaEntityPrototype doc in the new documentation
It is not listed in Factorio/doc-html/LuaEntityPrototype.html, the new folder that has been added with 0.12.18.
Yes, but LuaEntityPrototype and prototype definition are two different things (although related).
The LuaEntityPrototype is in-game read only interface to get info about the prototype from the script.
The EntityPrototypeDefinition is the specification of the entity, of how should it be created in the mod/vanilla lua data files.
Now we just need some system that exports all prototype properties from every prototype definition (single and multiple inheritance included)
