Entity image positioning question.

Place to get help with not working mods / modding interface.
Post Reply
Guardian9978
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 10, 2013 2:51 am
Contact:

Entity image positioning question.

Post by Guardian9978 »

There's a couple settings for Lua entities that I'm confused about.

I'm guessing "drawing_scale = 0.7" is drawing images 70% smaller.
I'm more confused on how "shift" works. I can see it's an offset but on how it's applied to the images I have no idea.

ficolas
Smart Inserter
Smart Inserter
Posts: 1068
Joined: Sun Feb 24, 2013 10:24 am
Contact:

Re: Entity image positioning question.

Post by ficolas »

shift moves the place where the picture is drawn, check trees definition

Guardian9978
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 10, 2013 2:51 am
Contact:

Re: Entity image positioning question.

Post by Guardian9978 »

The shift amount is so small I can't map it manually on a image to select my own custom locations to draw at.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Entity image positioning question.

Post by kovarex »

The shift is in tiles, so 1 = 32px

Guardian9978
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 10, 2013 2:51 am
Contact:

Re: Entity image positioning question.

Post by Guardian9978 »

Another question is does the count start from the bottom left of them image?

Like so: (A 96x96 image would be displayed like so)
[7][8][9]
[4][5][6]
[1][2][3]

So if shift = {1,1} would get the bottom left 32x32 section?

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Entity image positioning question.

Post by kovarex »

The center of the picture is centered on the position of the entity.
The shift is the shift of the picture from this position.
So when you do shift {1, 1}, the picture (center) will be 32 px to the right and 32px down.
So 96X96 will have left top corner 16 px above and 16 px on the left of the center of the entity.

Guardian9978
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 10, 2013 2:51 am
Contact:

Re: Entity image positioning question.

Post by Guardian9978 »

Awesome information very useful. Thank you very much.

Guardian9978
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri May 10, 2013 2:51 am
Contact:

Re: Entity image positioning question.

Post by Guardian9978 »

Sorry for double posting.

I'm attempting to make a program to help with image placement but I can't get the Fire animation to line up correctly with the furnace using the furnace shift and fire_animation shift numbers.

Any help would be great.

kovarex
Factorio Staff
Factorio Staff
Posts: 8078
Joined: Wed Feb 06, 2013 12:00 am
Contact:

Re: Entity image positioning question.

Post by kovarex »

Ah, interesting.
The problem probably is that the furnace is also scaled down a little bit.

Code: Select all

drawing_scale = 0.7,
This is just custom value from the time we were testing furnace, and later we will move this option to the picture/animation definition same way shift is there.
PS. What is the reason to use the scale at all? When you use larger image and scale it to 50%, it has more details when you zoom in ...

Post Reply

Return to “Modding help”