Page 1 of 1
Canvas gui element
Posted: Sat Jun 22, 2019 12:56 am
by adamius
I'd like to draw graphs and arbitrary lines in a canvas like gui element.
Use it for utilisation, custom shapes, lines circles etc. Essentially I'd like to have the equivalent of the luarendering API but instead targetting an gui element to draw into.
Re: Canvas gui element
Posted: Sat Jun 22, 2019 12:28 pm
by Rseding91
I don't see this as ever happening sorry.
Re: Canvas gui element
Posted: Sat Jun 22, 2019 1:02 pm
by eradicator
Use a camera gui element on a black surface. Then use LuaRendering to draw to that surface *cough*. I need to go now.
Re: Canvas gui element
Posted: Sat Jun 22, 2019 1:04 pm
by Bilka
eradicator wrote: ↑Sat Jun 22, 2019 1:02 pm
Use a camera gui element on a black surface. Then use LuaRendering to draw to that surface *cough*. I need to go now.
That is the use case of the modding interface request that initially led to the addition of LuaRendering so don't think I'm unaware of the hacks that people are doing with it :p
Re: Canvas gui element
Posted: Sat Jun 22, 2019 1:30 pm
by adamius
eradicator wrote: ↑Sat Jun 22, 2019 1:02 pm
Use a camera gui element on a black surface. Then use LuaRendering to draw to that surface *cough*. I need to go now.
My plan exactly. I need high contrast text and a way to draw graphs. So Plan B it is.
Rendering GuiElement
Posted: Fri Oct 04, 2019 8:58 am
by BlackCap
Add a blank GUI element that can be rendered using the LuaRendering API.
This is already possible using cameras, but cameras require you to create a surface, which feels dirty:
Code: Select all
local surf = game.create_surface(surface_name, game.default_map_gen_settings)
local cam = container.add
{ type = 'camera'
, surface_index = surf.index
, position = { x = ix, y = 0 }
, zoom = scale
}
Intuitively this has a fair bit of overhead: I am creating a new universe that can have entities and pollution and wind and a day/night cycle and stuff, but all I wanted was to draw a snazzy button. How often is it redrawn? Presumably 60 times a second!
Ideally there would be a RenderingBuffer object that is decoupled from the game world. Something I can render once and display in a gui render element.
Re: Rendering GuiElement
Posted: Fri Oct 04, 2019 9:42 am
by eradicator
Re: Rendering GuiElement
Posted: Fri Oct 04, 2019 10:43 am
by BlackCap
Can I close/delete my own thread?
Re: Canvas gui element
Posted: Fri Oct 04, 2019 4:43 pm
by Koub
[Koub] Merged the newer topic into the older .