[Genhis][2.0.68] LuaRendering::draw_text shows up in fog of war with rich text
Posted: Sat Sep 27, 2025 4:17 pm
I've gotten a bug report about my mod Biter Memoirs about our LuaRenderObjects showing up in fog of war. With a bit of investigating, I've found it's specifically the use_rich_text option that causes this.
Take this snippet of code, and then hover over an entity near the left edge of fog of war
You'll see Position Two show up in the fog of war
Now go to the command again, and change the argument to false
You'll see that there's now only Position One. Position Two will show up if you clear the fog of war
Take this snippet of code, and then hover over an entity near the left edge of fog of war
You'll see Position Two show up in the fog of war
Now go to the command again, and change the argument to false
You'll see that there's now only Position One. Position Two will show up if you clear the fog of war
Code: Select all
/c
local function test(use_rich)
local selected = game.player.selected
local surface = selected.surface
local position_one = selected.position
local position_two = {position_one.x - 10, position_one.y}
local render_args = {
text = "Position One",
surface = surface,
color = {1,1,1},
target = position_one,
use_rich_text = use_rich,
}
rendering.draw_text(render_args)
render_args.text = "Position Two"
render_args.target = position_two
rendering.draw_text(render_args)
end
test(true)