Hello there,
I am trying to create a website on which you can edit saved blueprints. But currently I am stucked at displaying the blueprint. I use the information from data/base/prototypes/entity/demo-entities.lua etc. namly entity.selection_box, entitiy.drawing_box, entity.pictures.filename, entity.pictures.width and entity.pictures.height. I already found out that the base unit for the pictures is 32 pixels. But currently the pictures are not shiftet by entity.pictures.shift, because every variation on how to use these values does not result in a correct preview.
Can anybody help me with entity.picture.shift?
To give you an idea of what I am doing: https://ght.io/factorio/blueprint/
In this example especially the accumulators and the radar is misplaced.
Legal Question: Is it allowed to use the graphics and scripts in raw or preprocessed way on a third party website?
Thanks,
Gerhard
(Example copied from https://forums.factorio.com/forum/vie ... 168#p39903)
Picture positioning
Re: Picture positioning
I used paint to aid me.
Left accumulator: Factorio places center of image in center of entity and shift is used to tweak image position.
Right accumulator: This is what I believe to be your case. topleft corners of selectionbox and image in same position. Not sure if this aligns right but. If you replace this
with thisHow does it look?
Left accumulator: Factorio places center of image in center of entity and shift is used to tweak image position.
Right accumulator: This is what I believe to be your case. topleft corners of selectionbox and image in same position. Not sure if this aligns right but. If you replace this
Code: Select all
if false and g.shift then
gra.style.marginLeft = -g.shift[1] .. 'em'
gra.style.marginTop = g.shift[1] .. 'em'
Code: Select all
if g.shift then
gra.style.marginLeft = g.shift[1] - left - g.width / 64 .. 'em'
gra.style.marginTop = g.shift[2] - top - g.height / 64 .. 'em'
Test mode
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Searching Flashlight
[WIP]Fluid handling expansion
[WIP]PvP gamescript
[WIP]Rocket Express
Autofill: The torch has been pass to Nexela
Re: Picture positioning
Thanks, that was the missing information I was not able to find… now I try to import the infos from the factorio data.lua files.
Re: Picture positioning
This is Awesome.
I copy pasted some of my blueprints into it and seen parts of them graphically outside of game.
When you finish this, Wow.
A suggestion: instead of red squares: have text in a box with entity name as shown in code
eventually, direct base/mod folder access
Possibly by saving the webpage to the Factorio folder and run it from there?
I copy pasted some of my blueprints into it and seen parts of them graphically outside of game.
When you finish this, Wow.
A suggestion: instead of red squares: have text in a box with entity name as shown in code
eventually, direct base/mod folder access
Possibly by saving the webpage to the Factorio folder and run it from there?
Re: Picture positioning
A first version is online: https://forums.factorio.com/forum/vie ... f=8&t=9025