local calculateScale = require(calculateScale)
local currentScale = calculateScale(myFrame)
local frameSize = frame.AbsoluteSize * currentScale
print(frameSize)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Value<T> = | |
((value: (T | (current: T) -> T)?, bypassSignals: boolean?) -> T) | |
& { | |
changed: RBXScriptSignal<T, T>, | |
initialValue: T, | |
destroy: () -> (), | |
reset: () -> (), | |
onChange: (callback: (prev: T, next: T) -> (), runOnInit: boolean?) -> (), | |
onReset: (() -> ())?, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local React = require("@pkgs/React") | |
local useMemo = React.useMemo | |
local useRef = React.useRef | |
type Predicate<T = unknown> = (a: T?, b: T) -> boolean | |
local function isStrictEqual(a: unknown?, b: unknown) | |
return a == b | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local React = require("@pkgs/React") | |
local useEffect = React.useEffect | |
local e = React.createElement | |
local function applyProps(target: Instance, props, applyRef) | |
for propName, propValue in props do | |
if propName == "children" or propName == "Parent" then | |
continue | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local React = require("@pkgs/React") | |
local useState = React.useState | |
local useEffect = React.useEffect | |
local function useAttribute<T>( | |
target: Instance, | |
attributeName: string, | |
fallbackValue: T? | |
): T? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--!strict | |
--[[ | |
Usage: | |
Build production release: | |
> `lune run build` | |
Build dev release to Roblox/Plugins directory: | |
> `lune run build -- --dev` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Parses a ISO 8601 UTC offset string into a float. | |
parseIsoUtcOffset("-0500") --> -5 | |
parseIsoUtcOffset("+02") --> 2 | |
parseIsoUtcOffset("-04:30") --> -4.5 | |
parseIsoUtcOffset("Z") --> 0 | |
local localTimezoneOffset = os.date("%z") | |
parseIsoUtcOffset(localTimezoneOffset) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local UserInputService = game:GetService("UserInputService") | |
local React = require(script.Parent.Parent.Packages.React) | |
local useState = React.useState | |
local useEffect = React.useEffect | |
local function calculateDpiScale() | |
local BUTTON_CONTENTID = UserInputService:GetImageForKeyCode(Enum.KeyCode.ButtonA) | |
local BUTTON_SCALE = BUTTON_CONTENTID:lower():match("@([%d%.]-)x%.%w+$") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Format: | |
```lua | |
REGION_CODE = { | |
{ STD, DST }, | |
} | |
``` | |
]] | |
return { |
NewerOlder