uniquadev / guitoluaconverter Goto Github PK
View Code? Open in Web Editor NEWBest Roblox Gui To Lua Converter
License: Apache License 2.0
Best Roblox Gui To Lua Converter
License: Apache License 2.0
windows 11
Hello, I am unable to figure out why FontFace is not converting properly and is causing me to have a meltdown when trying to patch this plugin.
I am converting my GUI to a Lua format but some fonts use the new format for font weight like semi-bold or extra-bold (https://create.roblox.com/docs/reference/engine/datatypes/Font) and it is not properly adding these properties and instead just commenting out the FontFace property and leaving incorrect formatting when running as a script.
-- G2L["12"]["FontFace"] = ;
G2L["12"]["Font"] = Enum.Font.Unknown;
I have made an addition to the script which allows NumberSequenceKeypoint operate with UIGradient Transparency property field within core.lua, please see the code. If you feel it is good enough then you can push it to the plugin if you want.
-- transpile property to lua
local function TranspileValue(RawValue:any)
local Value = '';
local Type = typeof(RawValue);
if Type == 'string' then
Value = EncapsulateString(RawValue);
elseif Type == 'number' or Type == 'boolean' or Type:match('^Enum') then
Value = tostring(RawValue);
-- %.3f format might be better
elseif Type == 'Vector2' then
Value = ('Vector2.new(%s, %s)'):format(
RawValue.X, RawValue.Y
);
elseif Type == 'Vector3' then
Value = ('Vector3.new(%s, %s, %s)'):format(
RawValue.X, RawValue.Y, RawValue.Z
);
elseif Type == 'UDim2' then
Value = ('UDim2.new(%s, %s, %s, %s)'):format(
RawValue.X.Scale, RawValue.X.Offset,
RawValue.Y.Scale, RawValue.Y.Offset
);
elseif Type == 'UDim' then
Value = ('UDim.new(%s, %s)'):format(
RawValue.Scale, RawValue.Offset
);
elseif Type == 'Rect' then
Value = ('Rect.new(%s, %s, %s, %s)'):format(
RawValue.Min.X, RawValue.Min.Y,
RawValue.Max.X, RawValue.Max.Y
);
elseif Type == 'Color3' then
-- convert rgb float value to decimal
local R, G, B = math.ceil(RawValue.R * 255), math.ceil(RawValue.G * 255), math.ceil(RawValue.B * 255);
Value = ('Color3.fromRGB(%s, %s, %s)'):format(
R, G, B
);
elseif Type == "ColorSequence" then
local Keypoints = '';
for Idx, KeyPoint:ColorSequenceKeypoint in next, RawValue.Keypoints do
Keypoints = Keypoints .. ('ColorSequenceKeypoint.new(%.3f, %s),'):format(
KeyPoint.Time, TranspileValue(KeyPoint.Value)
);
end;
-- remove last comma
Keypoints = Keypoints:sub(1, -2);
Value = ('ColorSequence.new{%s}'):format(Keypoints);
elseif Type == "NumberSequence" then -- This will allow me to make UIGradients transparency keyframes work as intended
-- Just stole code from above and adapted it lol
local Keypoints = '';
for Idx, KeyPoint:NumberSequenceKeypoint in next, RawValue.Keypoints do
Keypoints = Keypoints .. ('NumberSequenceKeypoint.new(%.3f, %s),'):format(
KeyPoint.Time, TranspileValue(KeyPoint.Value)
);
end;
-- remove last comma
Keypoints = Keypoints:sub(1, -2);
Value = ('NumberSequence.new{%s}'):format(Keypoints);
end
return Value;
end
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.