Hi there,
Simple question. I've recently gotten some custom graphics from Yuokitani he has done an fantastic job but how would I go about figuring out the following things?
Width
Height
Shift
Scale
http://johnsmith.ktec.de/factorio/mods/ ... _sheet.png
http://johnsmith.ktec.de/factorio/mods/ ... _sheet.png
^
Figuring width and height of textures
- darkshadow1809
- Filter Inserter
- Posts: 306
- Joined: Thu Jan 15, 2015 10:13 pm
- Contact:
Figuring width and height of textures
ShadowsModpackDevelopment
-
- Filter Inserter
- Posts: 478
- Joined: Sat Aug 23, 2014 11:43 pm
- Contact:
Re: Figuring width and height of textures
width = (sprites along x axis) / (texture width)
height = (sprites along y axis) / (texture height)
shift i have no idea but YuokiTani made a tool to calculate it viewtopic.php?f=135&t=12171&p=82661&hil ... ift#p81858
scale depends on what size you want the building to have in game. a 32x32 image of a chest with scale = 1 will have the size 1x1 tile. with scale = 2 the size will be 2x2. the formula is: scale(tileSize, imageSize) = tileSize / (imageSize / 32)
s33_sheet:
height = (sprites along y axis) / (texture height)
shift i have no idea but YuokiTani made a tool to calculate it viewtopic.php?f=135&t=12171&p=82661&hil ... ift#p81858
scale depends on what size you want the building to have in game. a 32x32 image of a chest with scale = 1 will have the size 1x1 tile. with scale = 2 the size will be 2x2. the formula is: scale(tileSize, imageSize) = tileSize / (imageSize / 32)
s33_sheet:
- width = 4 / 1024 = 256
- height = 4 / 1024 = 256
- scale with a tile size of 4x4 the scale should be scale(4, 256) = 0.5, with tile size 3 scale(3, 256) = 0.375
- width = 4 / 1280 = 320
- height = 4 / 1280 = 320
- scale with tile size 4 scale(4, 320) = 0.4, with tile size 3 scale(3, 320) = 0.3
Waste of bytes : P
- darkshadow1809
- Filter Inserter
- Posts: 306
- Joined: Thu Jan 15, 2015 10:13 pm
- Contact:
Re: Figuring width and height of textures
Ohh that makes a lot more sense. Lol thanks a lot man!keyboardhack wrote:width = (sprites along x axis) / (texture width)
height = (sprites along y axis) / (texture height)
shift i have no idea but YuokiTani made a tool to calculate it viewtopic.php?f=135&t=12171&p=82661&hil ... ift#p81858
scale depends on what size you want the building to have in game. a 32x32 image of a chest with scale = 1 will have the size 1x1 tile. with scale = 2 the size will be 2x2. the formula is: scale(tileSize, imageSize) = tileSize / (imageSize / 32)
s33_sheet:s44_sheet
- width = 4 / 1024 = 256
- height = 4 / 1024 = 256
- scale with a tile size of 4x4 the scale should be scale(4, 256) = 0.5, with tile size 3 scale(3, 256) = 0.375
- width = 4 / 1280 = 320
- height = 4 / 1280 = 320
- scale with tile size 4 scale(4, 320) = 0.4, with tile size 3 scale(3, 320) = 0.3
ShadowsModpackDevelopment
Re: Figuring width and height of textures
And some method for cropping empty space by sprites for sprite sheet?
-
- Filter Inserter
- Posts: 478
- Joined: Sat Aug 23, 2014 11:43 pm
- Contact:
Re: Figuring width and height of textures
If you mean going from thisdarkfrei wrote:And some method for cropping empty space by sprites for sprite sheet?

to this

Then the game already does that for you when it loads the mod. With a zipped mod it probably only takes a dozen bytes extra per texture so it's probably not worth doing yourself.
Waste of bytes : P
Re: Figuring width and height of textures
Also, I can render 512x512 pixels sprites with 128x128 pixels entities, for example, 64 frames pro sprite sheet without problem with memory?keyboardhack wrote: Then the game already does that for you when it loads the mod. With a zipped mod it probably only takes a dozen bytes extra per texture so it's probably not worth doing yourself.
I think nobody need too much free space on the sprite.