I’m new to using Fusion for UI and I am wondering if there are any built in methods for auto scaling UI Strokes and size. I know how to calculate both normally, I just want to see if there is an easier way.
Dont use fusion
its just a bloatware and is hell to use and designed to be hard for a sake of it.
If you want to have readable hierarchy you can use [1.3.2] Hierarchy Builder - Lightweight D.S.L
That is straight forward and entire framework is just 140 lines of code (v1.3.2 at least)
As for UIStroke scaling here: UIStrokes Scaling made simple
First:
You’re friends with the guy who made Hierarchy Builder which makes it seem like this reply is self-promo. Self promotion, seriously? In a help forum?
Second:
You’re reply doesn’t help nor answer my question in any way shape or form. I previously stated I already know how to manually calculate UI Stroke scaling, I just want to know if there are any built in Fusion methods to make it easier.
Third:
Fusion is definitely not bloatware. It is widely support by many popular developers including L_eif and Quenty. I also like to think of it as an entry UI framework for people who want to learn more complicated frameworks. Heirarchy Builder also doesn’t have lots of documentation by other people which makes it hard to learn and use. 140 lines of code makes it seem like this framework isn’t type annotated which again, makes it hard to learn and use.
That not a self promo
that a common sense
There no any alternatives that i can find at all
I made that based on information i have without any bias don’t acuse me of things i never did.Also going so far as checking entire profile is weird bro
It has official documentation that explains everything pretty well https://github.com/towerscripter1386/InstanceBuilder/tree/main/docs
You know only idiot admires complexity that a common knowledge.
The lesser lines of code alghoritm has the better it is and the syntax will only prove that.
I bet that any person who has been studying roblox for about 2 weeks is capable on using it and heck even being sort of power user in it which i cant relate to bloated fusion/react.
This is called bias by the way “Subjective opinion” in other words.
here is implementation example:
local HierarchyBuilder = require("./HierarchyBuilder")
local Camera = workspace.CurrentCamera
local DynamicUpdate:{UIStroke} = table.create(1)::{UIStroke}
local function Update():()
local ViewPort:Vector2 = Camera.ViewportSize
local ratio:number = math.min(ViewPort.X,ViewPort.Y)/ViewPort.Y
for i,v in DynamicUpdate do
v.Thickness = ratio *(v:GetAttribute("Thickness" or 5))::number
end
end
Camera:GetPropertyChangedSignal("ViewportSize"):Connect(Update)
local InheretedScale:HierarchyBuilder.BaseEntry = {
_init = function(self:UIStroke):()
table.insert(DynamicUpdate,self)
end
}
local Hierarchy = HierarchyBuilder{Type = "UIStroke";
_base = InheretedScale;
_exec = {
SetAttribute = {"Thickness",5};
};
}
task.defer(Update)
Not a single word in this justification post answers my question
I have updated the post to include implementation example
Simplicity does not always mean expandability. 140 lines of code tells me this framework offers nothing of what Fusion or React has. Also, when someone asks a question, you don’t tell them to do something off topic. You HELP them.
What fusion and react offers that this framework doesnt?
To me it only offers unneeded bloatware that makes every player rage from low perfomance.
Are we back in 2017 where developers make games on roblox intentionally laggy?
Maybe if you actually go on the Fusion website you can see why it’s useful. Every word you utter relates nothing to my original question which is why I’m ending the post here. Ima just calculate everything manually.
You are probably looking for something similar to usePx. It properly scales pixel-based offsets and sizes and maintains aspect ratio. Very useful. Copy and paste from the init.luau here: pretty-fusion-utils/src/use-px at main · znotfireman/pretty-fusion-utils · GitHub
There’s no usage example in the README, but I believe the following works (something might be wrong; I’m not too familiar with Fusion, in particular):
-- Scope setup
local Fusion = require(path.to.fusion)
local scoped = Fusion.scoped
local usePx = require(path.to.usePx)
local scope = scoped(Fusion, { usePx = usePx })
-- In a component (scope parameter is the above)
local function component(scope)
local px = scope:usePx()
return scope:New("Frame")({
Size = px(UDim2.fromOffset(800, 600)), -- Size scales appropriately
[scope.Children] = {
scope:New("UIStroke")({
Thickness = px(10), -- UIStroke thickness will also scale
}),
},
})
end
Thank you and you’re kind soul ![]()
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.