Page 1 of 1

Extended flying text entity.

Posted: Sat Aug 15, 2015 4:36 pm
by Adil
It would be useful to have textual entity, which can live indefinitely and is not resized with zooming.
Also, text alignment control would be nice. At least text centered around its position seems to me more consistent with other entities than the current left alignment.

Re: Extended flying text entity.

Posted: Sun Aug 16, 2015 10:00 pm
by Rahjital
You can make your own flying text entity:

Code: Select all

data:extend(
{ 
  {
    type = "flying-text",
    name = "flying-text",
    flags = {"not-on-map"},
    time_to_live = 150,
    speed = 0.05
  }
}
)
That's the default entity's data. Just change time_to_live to something ridiculously high and speed to 0 and you've got yourself an infinite flying-text entity.

Re: Extended flying text entity.

Posted: Mon Aug 17, 2015 3:13 pm
by Adil
Ridiculously high is not infinite time (You cant set that to math.huge or 1/0). I really don't agree with practice of "oh I'll just set it to the biggest number that comes to my head instead of doing everything correctly". Besides, this way the game still performs a number of useless arithmetic to determine whether it time for eternal text to die. I don't know whether setting the text entity inactive (which is what I do now) disables those checks.

Regardless, apart from this somewhat personal matter, there are other features requested:
1) Immunity to zoom, so that text preserves its relative size to ingame entities no to the screen.
2) Alignment control, currently, when you spawn any other entity, you provide its central position. For text, the position parameter is used as the position of the beginning of the string.
No, you cannot create flying text entity with such properties by modifying the current prototype.

Re: Extended flying text entity.

Posted: Mon Aug 17, 2015 10:13 pm
by Rahjital
That's a technicality. You can put in the signed 32-bit integer limit and have the text stay for almost ten thousand hours, which is more than a year of playing the game day and night. Yes, it is inelegant, but you don't have the source code of the game to care too much about that, this was just a way to get it working without having to wait for the implementation. Looking at your signpost mod, you've found a better way to do it by deactivating the flying text entity, so the point is moot anyway.

The request is still very much valid, though, additional options for the flying text entity would be great. Perhaps, instead of making the text stay the same size, it should not render if you zoom out more than a certain amount?

[Improvement] Add a bool to "flying-text" for scaling

Posted: Wed Jan 13, 2016 7:30 pm
by Ichorio
merged with existing request
-- daniel34


Just a simple suggestion for adding a bool to disable the scaling of flying-text with the zoom.
This way you can disable text in the world, instead of having a tile to display the text itself.
With it disabled, it could try to fit in the width of a tile, or maybe a bounding box that's supplied with the prototype.

Re: Extended flying text entity.

Posted: Thu Feb 23, 2017 10:21 pm
by Adil
So, it's been 18 months and 80 releases since the creation of the original signpost mod and yet its successors are still limited to the same cludgy ways of expressing themselves.
Let this request surface once more.

And remind of other relevant one as well.

Re: Extended flying text entity.

Posted: Fri Apr 07, 2017 11:27 pm
by Nexela
I would love it if flying-text prototype had an option to not scale-with-zoom


As for time to live/speed: To have it stay indefinitely just set it to active=false after it is created.
My guess is getting the "center" point of the string would not be possible due to localisations.

Re: Extended flying text entity.

Posted: Fri Jan 04, 2019 6:18 pm
by Bilka
The text implemented in the new script rendering which I implemented for 0.17 can be set to not scale: https://lua-api.factorio.com/0.17.0-pre ... _with_zoom and have any lifetime you set (including infinite). I hope this helps solve this long standing problem :)