1. What do you want to achieve? Keep it simple and clear!
Im making a drawing plugin, for drawing icons or for fun, the name is “Icon Maker”
2. What is the issue? Include screenshots / videos if possible!
Im currently making the layer system, but i think i understood ZIndex wrong. The way i made the layer system is the following:
Layers are CanvasGroups, all inside a single folder
Each Layer has a ‘Content’ folder for the paint, and a ‘Strokes’ CanvasGroup with another ‘Content’ folder for outlines
The Zindex for everything is the following:
Layer1: x
Strokes: x+1
Paint: x+2+amount of paint
And for new layers i would simply just increase the Layer Zindex, like this:
Layer2: x+1
Strokes: x+2
Paint: x+3+amount of paint
The main idea was that the Zindex only affected parents, so if the layer ZIndex is bigger than the other layers, any children inside it will also be on top
But instead, parents have nothing to do with Zindex, so all the paint is on top of each other, the only difference being the ‘amount of paint’, so newer paints are on top of old paint
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have thought of a way around it, but i would have to calculate the ZIndex of multiple paint, and that would lag very easily
Despite that, i think really look into it
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
If anyone knows a better way around it, or maybe something else that works i would be very happy to try it
this is how i calculate ‘number of paint’, by the way this number never decreases or resets
Amount of paint is simply just a way for paint to be on top of each other, so every time you click, it adds a frame and increases ‘DrawIndex’, that being the ‘Amount of paint’
It’s the plugin im trying to make, its a drawing plugin, in case you want to draw your own icons for a game or just for fun, wdym by “can you do without it”?
--local TagS = game:GetService("CollectionService")
local Selection = game:GetService("Selection")
local toolbar = plugin:CreateToolbar("Draw")
local newScriptButton = toolbar:CreateButton("Icon Maker",
"Make your own icon",
"rbxasset://studio_svg_textures/Shared/InsertableObjects/Dark/Standard/Workspace@3x.png")
newScriptButton.ClickableWhenViewportHidden = true
local WindowContents = script.Parent.WidgetContent
local widgetInfo = DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float, -- Widget will be initialized in floating panel
false, -- Widget will be initially enabled
false, -- Don't override the previous enabled state
800, -- Default width of the floating window
800, -- Default height of the floating window
600, -- Minimum width of the floating window (optional)
600 -- Minimum height of the floating window (optional)
)
local testWidget = plugin:CreateDockWidgetPluginGui("IconMaker", widgetInfo)
testWidget.Name = "Icon Maker"
local OpenW = testWidget.Enabled or false
--print(OpenW)
testWidget.Title = "Icon Maker"
WindowContents.Parent = testWidget
newScriptButton.Click:Connect(function()
OpenW = not OpenW
if OpenW then
testWidget.Enabled = true
else
testWidget.Enabled = false
end
end)
But i dont know how it renders, it just does
in any case, i will try switching it to ScreenGui to see what happens