Page 1 of 1

simple-entity-with-animation

Posted: Wed Jun 07, 2017 8:53 pm
by darkfrei
Hi! Is it possible to make the new simple entity?

For example something like roboport or electric furnace. It will be good, when it will be possible to set speed of animation and type of playing (cycle, just once, forward-reverse and just reverse once).
from electric furnace, it has animated ventilator

Re: simple-entity-with-animation

Posted: Thu Jan 31, 2019 7:54 pm
by Bilka
I added animations to LuaRendering which should make this possible a slightly different way. You just define an animation prototype and then draw it in-game with LuaRendering. You can change the animation speed and render layer.

Re: simple-entity-with-animation

Posted: Fri Feb 01, 2019 8:18 am
by darkfrei
Bilka wrote:
Thu Jan 31, 2019 7:54 pm
I added animations to LuaRendering which should make this possible a slightly different way. You just define an animation prototype and then draw it in-game with LuaRendering. You can change the animation speed and render layer.
Is it possible to set color to any entity on control stage?

Re: simple-entity-with-animation

Posted: Fri Feb 01, 2019 8:32 am
by Bilka
objects like the animation that are drawn with LuaRendering are not entities. You can set the tint on the animation created with luarendering. You cannot runtime set tint on some arbitrary entity that uses animations, like radar.

Re: simple-entity-with-animation

Posted: Fri Feb 01, 2019 9:38 am
by darkfrei
Bilka wrote:
Fri Feb 01, 2019 8:32 am
objects like the animation that are drawn with LuaRendering are not entities. You can set the tint on the animation created with luarendering. You cannot runtime set tint on some arbitrary entity that uses animations, like radar.
But I can set LuaRendering layer with same graphics as radar over this entity! It's visually tint of entity, but it isn't.

Nice to have some easy way do do this:
entity.rendering_sticker = {{image=entity_prototype_image, tint=tint}}

Re: simple-entity-with-animation

Posted: Fri Feb 01, 2019 9:44 am
by Bilka
darkfrei wrote:
Fri Feb 01, 2019 9:38 am
But I can set LuaRendering layer with same graphics as radar over this entity! It's visually tint of entity, but it isn't.
Yes.

Re: simple-entity-with-animation

Posted: Fri Feb 01, 2019 9:49 am
by darkfrei
Bilka wrote:
Fri Feb 01, 2019 9:44 am
darkfrei wrote:
Fri Feb 01, 2019 9:38 am
But I can set LuaRendering layer with same graphics as radar over this entity! It's visually tint of entity, but it isn't.
Yes.
So it can be done internal just from entity.tint = tint, and another will be done as attach LuaRendering with the same graphics and tinted LuaRendering?

Re: simple-entity-with-animation

Posted: Fri Feb 01, 2019 9:51 am
by Bilka
darkfrei wrote:
Fri Feb 01, 2019 9:49 am
So it can be done internal just from entity.tint = tint, and another will be done as attach LuaRendering with the same graphics and tinted LuaRendering?
Only some entities support run-time tint changes directly. This is not changing. To get around that limitation you can use the LuaRendering. Basically yes.