[HELP] Undocumented Function - Image.addLayerPaintStroke()
Hello! I need help figuring out the parameters for the Image.addLayerPaintStroke() function. It's not in the reference manual, but it can be found in the CoreRPG scripts and does exactly what I want: draw on an image layer.
From the only example in the ruleset, I was able to deduce that its parameters are:
Image.addLayerPaintStroke(node Image, Image Layer, Drawing Data)
The last one is a table with several parameters like Fill, Path, Stroke...
That's the problem. I can create a square, but the stroke doesn't appear. Checking the database, I can see that it did create the stroke, but its size is 0.0.
I have also tried to directly change the size in DB using DB.setValue(nodeImage, "size", "50,50") but with no success.
I need help figuring out how this function handles the tables and what the parameters are for strokes (or any other
Here is my function:
Code:
local nLayerID = Image.addLayer(nodeImage, "paint", { name = "Test Layer" })
if not nLayerID then return end
local tStrokeData = {
path = {
{ x=25, y=175 }, { x=525, y=175 },
{ x=525, y=625 }, { x=25, y=625 },
{ x=25, y=175 }
}
}
if bUseFill then
tStrokeData.fill = { color = sFillColor }
end
if bUseStroke then
tStrokeData.stroke = {
color = sStrokeColor,
size = "50,50"
-- size = {50,50}
-- size = 50,50
-- size = {w = 50, h = 50}
-- w = 50,
-- h = 50
}
end
Image.addLayerPaintStroke(nodeImage, nLayerID, tStrokeData)
The commented lines are other methods I tried with no success.
Any devs that can help me with that?