[0.12.19] Upper right corner entity display shifted out

Bugs that are actually features.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

[0.12.19] Upper right corner entity display shifted out

Post 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
Image
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...
Sprite data
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.19] Upper right corner entity display shifted out

Post 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.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.12.19] Upper right corner entity display shifted out

Post 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
pics
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 :D

EDIT: As aside note, the drawing_box isn't mentions in the LuaEntityPrototype doc in the new documentation
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.19] Upper right corner entity display shifted out

Post 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}}
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: [0.12.19] Upper right corner entity display shifted out

Post 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.
quick links: log file | graphical issues | wiki
kovarex
Factorio Staff
Factorio Staff
Posts: 8298
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: [0.12.19] Upper right corner entity display shifted out

Post 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.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5406
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.12.19] Upper right corner entity display shifted out

Post 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

Its looking good now
Rseding91
Factorio Staff
Factorio Staff
Posts: 15896
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [0.12.19] Upper right corner entity display shifted out

Post 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) :D
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Not a bug”