optional attribute for flying-text to anchor it to another entity

Post Reply
User avatar
Godmave
Long Handed Inserter
Long Handed Inserter
Posts: 89
Joined: Tue Nov 15, 2016 3:52 pm
Contact:

optional attribute for flying-text to anchor it to another entity

Post by Godmave »

with anchor being the entity

possible version:

Code: Select all

anchor.surface.create_entity{name = "flying-text", anchor=anchor, position = {0,0.5}, text = text, color = {r=1,g=0,b=0}}
or to better differentiate it from the normal variant:

Code: Select all

anchor.surface.create_entity{name = "flying-text", anchor=anchor, offset = {0,0.5}, text = text, color = {r=1,g=0,b=0}}
So, if you do that to a rolling stock or any other moving entity the text will follow it around.

Also nice to have attributes would be

Code: Select all

speed 
and

Code: Select all

ttl
(0=never die) so you do not have to tinker with the datastage for such simple things.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: optional attribute for flying-text to anchor it to another entity

Post by darkfrei »

And direction / rotation of entity?

It will be nice to have sticker with text. As option, glue this sticker to the player.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5148
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: optional attribute for flying-text to anchor it to another entity

Post by Klonan »

It would be better, to add rendering text to the highlight box entity, rather than give the flying text the ability to follow the entity.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: optional attribute for flying-text to anchor it to another entity

Post by eradicator »

Klonan wrote:
Tue Nov 13, 2018 10:54 am
It would be better, to add rendering text to the highlight box entity, rather than give the flying text the ability to follow the entity.
Does that imply highlight boxes can already follow entities :3?

I tried ontick teleporting a flying text onto a car the other day and was shocked how expensive that is.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Bilka
Factorio Staff
Factorio Staff
Posts: 3123
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: optional attribute for flying-text to anchor it to another entity

Post by Bilka »

Hello, this has been solved with the text object in the script rendering implemented in 0.17: https://lua-api.factorio.com/0.17.0-pre ... ering.html
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented mod requests”