Shift for shadow has another scale than shift for entity image

Bugs that are actually features.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Shift for shadow has another scale than shift for entity image

Post by darkfrei »

See mods: https://mods.factorio.com/mod/BigChests https://mods.factorio.com/mod/NuclearScale https://mods.factorio.com/mod/SchallMachineScaling

Code: Select all

  entity.picture.layers[1].scale = scale 
  entity.picture.layers[1].hr_version.scale = 0.5 * scale
  entity.picture.layers[2].scale = scale 
  entity.picture.layers[2].hr_version.scale = 0.5 * scale
  entity.picture.layers[2].shift[1] = 1.625 * scale
  entity.picture.layers[2].hr_version.shift[1] = 1.625 * scale
Where layer 1 - image, layer 2 - shadow.
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Shift for shadow has another scale than shift for entity image

Post by posila »

What you want is

Code: Select all

  entity.picture.layers[1].scale = scale 
  entity.picture.layers[1].shift = util.mul_shift(entity.picture.layers[1].shift, scale)
  entity.picture.layers[1].hr_version.scale = 0.5 * scale
  entity.picture.layers[1].hr_version.shift = util.mul_shift(entity.picture.layers[1].hr_version.shift, scale)
  
  entity.picture.layers[2].scale = scale 
  entity.picture.layers[2].shift = util.mul_shift(entity.picture.layers[2].shift, scale)
  entity.picture.layers[2].hr_version.scale = 0.5 * scale
  entity.picture.layers[2].hr_version.shift = util.mul_shift(entity.picture.layers[2].hr_version.shift, scale)
Post Reply

Return to “Not a bug”