From 947532f0643c3299a23142bad2b9ce3dfd2b1dfc Mon Sep 17 00:00:00 2001 From: routersys Date: Wed, 1 Jul 2026 13:07:45 +0900 Subject: [PATCH] =?UTF-8?q?MoonSharp=E3=81=A7obj.setoption=E3=81=AEblend?= =?UTF-8?q?=E3=82=92=E6=8F=8F=E7=94=BB=E3=81=B8=E5=8F=8D=E6=98=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript/LuaScriptEngine.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/LuaScript/LuaScriptEngine.cs b/LuaScript/LuaScriptEngine.cs index f32f0a3..7b79a92 100644 --- a/LuaScript/LuaScriptEngine.cs +++ b/LuaScript/LuaScriptEngine.cs @@ -587,7 +587,7 @@ namespace LuaScript double alpha = args.Count > 4 ? args[4].CastToNumber() ?? 1d : 1d; double aspect = args.Count > 5 ? args[5].CastToNumber() ?? 0d : 0d; - _activeContext.AddDraw(new DrawCommand(ox, oy, oz, zoom, alpha, aspect, null, CurrentAntialias())); + _activeContext.AddDraw(new DrawCommand(ox, oy, oz, zoom, alpha, aspect, null, CurrentAntialias(), CurrentBlend())); return DynValue.Void; }); @@ -623,7 +623,7 @@ namespace LuaScript _ => 1d, }; - _activeContext.AddDraw(new DrawCommand(0d, 0d, 0d, 1d, poly[20], 0d, poly, CurrentAntialias())); + _activeContext.AddDraw(new DrawCommand(0d, 0d, 0d, 1d, poly[20], 0d, poly, CurrentAntialias(), CurrentBlend())); return DynValue.Void; }); @@ -680,6 +680,11 @@ namespace LuaScript ? value.Number : 1d; + private double CurrentBlend() => + _options.TryGetValue("blend", out var value) && value.Type == DataType.Number + ? value.Number + : 0d; + private void LoadFigure(string name, int color, double size, double line, double aspect) { int boundingSize = Math.Max(1, (int)Math.Round(size));