How do you replace sprites with ones of higher resolution?

Place to get help with not working mods / modding interface.
CitizenJoe
Inserter
Inserter
Posts: 32
Joined: Thu Mar 24, 2016 8:14 am
Contact:

How do you replace sprites with ones of higher resolution?

Post by CitizenJoe »

For example: if i were to try and replace the spritesheet for the logistics robot with a completely different one that was double the resolution, how would I go about doing that?
adaroe
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Mar 28, 2016 10:24 am
Contact:

Re: How do you replace sprites with ones of higher resolution?

Post by adaroe »

the Waitex mod has the best example of how to override sprites, and would be a good place to start. Its a mod that adds hd textures to all the vaniila items/ entities in game.
User avatar
Arch666Angel
Smart Inserter
Smart Inserter
Posts: 1636
Joined: Sun Oct 18, 2015 11:52 am
Contact:

Re: How do you replace sprites with ones of higher resolution?

Post by Arch666Angel »

Crude method would be something like that:

Code: Select all

data.raw["entity"]["entityname"].animation={
filename = "__yourmod__/graphics/entity/entity/new-sprite.png",
priority = "extra-high",
width = 256,
height = 256,
scale = 0.5,
frame_count = 1,
},
You need to figure out what scale factor you need if you use higher res sprites.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5410
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: How do you replace sprites with ones of higher resolution?

Post by Klonan »

Yep using scale on the sprite definition is the best way,
At scale = 1 (aka default if you dont define it) than each pixel is a single pixel at zoom level 1 (press f9)
At scale 0.5, its essentially double the resolution
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: How do you replace sprites with ones of higher resolution?

Post by orzelek »

Klonan wrote:Yep using scale on the sprite definition is the best way,
At scale = 1 (aka default if you dont define it) than each pixel is a single pixel at zoom level 1 (press f9)
At scale 0.5, its essentially double the resolution
Could you investigate if it's possible that scale is used on one axis not on the other?

I tried to fix inserters in WaiTex at some point and it seemed that scaling was off on arm of inserter. It looked to stretched in one axis or disconnected on other depending on scale factor used.
Post Reply

Return to “Modding help”