repo stringclasses 302
values | file_path stringlengths 18 241 | language stringclasses 2
values | file_type stringclasses 4
values | code stringlengths 76 697k | tokens int64 10 271k |
|---|---|---|---|---|---|
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/DatePicker.luau | luau | .luau | --[=[
@class DatePicker
An interface for selecting a date from a calendar.
| Dark | Light |
| - | - |
|  |  |
This is a controlled component, which means you should pass in an initial date to the... | 3,041 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/DropShadowFrame.luau | luau | .luau | --[=[
@class DropShadowFrame
A container frame equivalent in appearance to a [Background] with a
drop shadow in the lower right sides and corner.
This matches the appearance of some built-in Roblox Studio elements such as tooltips.
It is useful for providing contrast against a background.
| Dark | Light |
| -... | 798 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Dropdown/ClearButton.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local useTheme = require("../../Hooks/useTheme")
type ClearButtonProps = {
Size: UDim2,
Position: UDim2,
AnchorPoint: Vector2,
OnActivated: () -> (),
}
local function ClearButton(props: ClearButtonProps)
local theme = useTheme()
local hovered, setHovered = React.us... | 369 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Dropdown/DropdownItem.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Constants = require("../../Constants")
local useTheme = require("../../Hooks/useTheme")
local BaseIcon = require("../Foundation/BaseIcon")
local DropdownTypes = require("./Types")
type DropdownItemProps = {
Id: string,
Text: string,
Icon: DropdownTypes.Dropdown... | 806 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Dropdown/Types.luau | luau | .luau | --[=[
@within Dropdown
@type DropdownItem string | DropdownItemDetail
]=]
export type DropdownItem = string | DropdownItemDetail
--[=[
@within Dropdown
@interface DropdownItemDetail
@field Id string
@field Text string
@field Icon DropdownItemIcon?
]=]
export type DropdownItemDetail = {
Id: string,
Text: st... | 223 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Foundation/BaseButton.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local CommonProps = require("../../CommonProps")
local Constants = require("../../Constants")
local getTextSize = require("../../getTextSize")
local useTheme = require("../../Hooks/useTheme")
local BaseIcon = require("./BaseIcon")
local PADDING_X = 8
local PADDING_Y = 4... | 1,208 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Foundation/BaseIcon.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local CommonProps = require("../../CommonProps")
export type BaseIconConsumerProps = CommonProps.T & {
Image: string,
Transparency: number?,
Color: Color3?,
ResampleMode: Enum.ResamplerMode?,
RectOffset: Vector2?,
RectSize: Vector2?,
}
export type BaseIconProps = B... | 234 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Foundation/BaseLabelledToggle.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local CommonProps = require("../../CommonProps")
local Constants = require("../../Constants")
local getTextSize = require("../../getTextSize")
local useTheme = require("../../Hooks/useTheme")
local DEFAULT_HEIGHT = Constants.DefaultToggleHeight
local BOX_SIZE = 16
local ... | 852 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Foundation/BaseTextInput.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local CommonProps = require("../../CommonProps")
local Constants = require("../../Constants")
local getTextSize = require("../../getTextSize")
local useTheme = require("../../Hooks/useTheme")
local PLACEHOLDER_TEXT_COLOR = Color3.fromRGB(102, 102, 102)
local EDGE_PADDING... | 1,581 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/Label.luau | luau | .luau | --[=[
@class Label
A basic text label with default styling to match built-in labels as closely as possible.
| Dark | Light |
| - | - |
|  |  |
By default, text color matches the current theme's MainText co... | 921 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/LoadingDots.luau | luau | .luau | --[=[
@class LoadingDots
A basic animated loading indicator. This matches similar indicators used in various places
around Studio. This should be used for short processes where the user does not need to see
information about how complete the loading is. For longer or more detailed loading processes,
consider us... | 740 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/MainButton.luau | luau | .luau | --[=[
@class MainButton
A variant of a [Button] used to indicate a primary action, for example an 'OK/Accept' button
in a modal.
| Dark | Light |
| - | - |
|  |  |
See the docs for [Button] fo... | 344 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/NumberSequencePicker/AxisLabel.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Constants = require("../../Constants")
local useTheme = require("../../Hooks/useTheme")
local function AxisLabel(props: {
AnchorPoint: Vector2?,
Position: UDim2?,
TextXAlignment: Enum.TextXAlignment?,
Value: number,
Disabled: boolean?,
})
local theme = useThem... | 206 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/NumberSequencePicker/Constants.luau | luau | .luau | return {
EnvelopeTransparency = 0.65,
EnvelopeColorStyle = Enum.StudioStyleGuideColor.DialogMainButton,
EnvelopeHandleHeight = 16,
}
| 36 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/NumberSequencePicker/DashedLine.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local useTheme = require("../../Hooks/useTheme")
local TEX_HORIZONTAL = "rbxassetid://15431624045"
local TEX_VERTICAL = "rbxassetid://15431692101"
local function DashedLine(props: {
AnchorPoint: Vector2?,
Position: UDim2?,
Size: UDim2,
Direction: Enum.FillDirection,
... | 293 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/NumberSequencePicker/FreeLine.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local TEX = "rbxassetid://15434098501"
local function FreeLine(props: {
Pos0: Vector2,
Pos1: Vector2,
Color: Color3,
Transparency: number?,
ZIndex: number?,
Disabled: boolean?,
})
local mid = (props.Pos0 + props.Pos1) / 2
local vector = props.Pos1 - props.Pos0
lo... | 286 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/NumberSequencePicker/LabelledNumericInput.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Label = require("../Label")
local NumericInput = require("../NumericInput")
local TextInput = require("../TextInput")
local getTextSize = require("../../getTextSize")
local PADDING = 5
local INPUT_WIDTH = 40
local function format(n: number)
return string.format(`... | 461 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/NumberSequencePicker/SequenceNode.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local useMouseDrag = require("../../Hooks/useMouseDrag")
local useMouseIcon = require("../../Hooks/useMouseIcon")
local useTheme = require("../../Hooks/useTheme")
local PickerConstants = require("./Constants")
local CATCHER_SIZE = 15
local ENVELOPE_GRAB_HEIGHT = PickerCo... | 2,425 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/NumberSequencePicker/init.luau | luau | .luau | --[=[
@class NumberSequencePicker
An interface for modifying [NumberSequence](https://create.roblox.com/docs/reference/engine/datatypes/NumberSequence) values.
This closely resembles the built-in NumberSequence picker for editing properties, with minor adjustments
for improved readability.
| Dark | Light |
| - ... | 3,976 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/NumericInput.luau | luau | .luau | --[=[
@class NumericInput
An input field matching the appearance of a [TextInput] but which filters inputted text to only
allow numeric values, optionally with arrow and slider controls.
| Dark | Light |
| - | - |
|  | .
You do not have to use this component unless you want custom mouse icons via the [useMouse... | 563 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/ProgressBar.luau | luau | .luau | --[=[
@class ProgressBar
A basic progress indicator. This should be used for longer or more detailed loading processes.
For shorter loading processes, consider using a [LoadingDots] component.
| Dark | Light |
| - | - |
|  | . This grouping behavior is not included and must be
implemented separately.
... | 817 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/ScrollFrame/Constants.luau | luau | .luau | return {
ScrollBarThickness = 16,
WheelScrollAmount = 48,
ArrowScrollAmount = 16,
}
| 26 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/ScrollFrame/ScrollBar.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local useMouseDrag = require("../../Hooks/useMouseDrag")
local useTheme = require("../../Hooks/useTheme")
local Constants = require("./Constants")
local ScrollBarArrow = require("./ScrollBarArrow")
local Types = require("./Types")
local SCROLLBAR_THICKNESS = Constants.Sc... | 1,588 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/ScrollFrame/ScrollBarArrow.luau | luau | .luau | local RunService = game:GetService("RunService")
local React = require("@pkg/@jsdotlua/react")
local useFreshCallback = require("../../Hooks/useFreshCallback")
local useTheme = require("../../Hooks/useTheme")
local Constants = require("./Constants")
local Types = require("./Types")
local ARROW_IMAGE = "rbxassetid:/... | 970 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/ScrollFrame/Types.luau | luau | .luau | export type ScrollData = {
ContentSize: Vector2,
WindowSize: Vector2,
InnerBarSize: Vector2,
BarVisible: { X: boolean, Y: boolean },
BarSize: Vector2,
BarPosition: Vector2,
}
export type BarOrientation = "Horizontal" | "Vertical"
return {}
| 68 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Components/ScrollFrame/init.luau | luau | .luau | --[=[
@class ScrollFrame
A container with scrollable contents. This works the same way as a built-in [ScrollingFrame] but
has visual changes to match the appearance of built-in scrollers in Studio.
| Dark | Light |
| - | - |
|  |  | 
export type PluginContext = {
plugin: Plugin,
pushMouseIcon: (icon: string) -> string,
popMouseIcon: (id: string) -> (),
}
return React.createContext(nil :: PluginContext?)
| 56 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Contexts/ThemeContext.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
return React.createContext(nil :: StudioTheme?)
| 21 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Hooks/useFreshCallback.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
type Callback<Args..., Rets...> = (Args...) -> Rets...
local function useFreshCallback<Args..., Rets...>(
-- stylua: ignore
callback: Callback<Args..., Rets...>,
deps: { any }?
): Callback<Args..., Rets...>
local ref = React.useRef(callback) :: { current: Callback<Arg... | 128 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Hooks/useMouseDrag.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local useFreshCallback = require("../Hooks/useFreshCallback")
local function useMouseDrag(
callback: (rbx: GuiObject, input: InputObject) -> (),
deps: { any }?,
onBeganCallback: ((rbx: GuiObject, input: InputObject) -> ())?, -- NB: consumer needs to guard against stale... | 776 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Hooks/useMouseIcon.luau | luau | .luau | --[=[
@class useMouseIcon
A hook used internally by components for setting and clearing custom mouse icons. To use this
hook, you need to also render a single [PluginProvider] somewhere higher up in the tree.
To set the mouse icon, use the `setIcon` function and pass an asset url. All components under
the Plugi... | 634 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Hooks/usePlugin.luau | luau | .luau | --[=[
@class usePlugin
A hook used to obtain a reference to the root [plugin](https://create.roblox.com/docs/reference/engine/classes/Plugin)
instance associated with the current plugin. It requires a single [PluginProvider] to be present
higher up in the tree.
```lua
local function MyComponent()
local plug... | 141 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Hooks/useTheme.luau | luau | .luau | --[=[
@class useTheme
A hook used internally by components for reading the selected Studio Theme and thereby visually
theming components appropriately. It is exposed here so that custom components can use this
API to achieve the same effect. Calling the hook returns a [StudioTheme] instance. For example:
```lua... | 269 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Background.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Background = require("../Components/Background")
local createStory = require("./Helpers/createStory")
local function Story()
return React.createElement(Background)
end
return createStory(Story)
| 49 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Button.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Button = require("../Components/Button")
local createStory = require("./Helpers/createStory")
local function StoryButton(props: {
Text: string?,
HasIcon: boolean?,
Disabled: boolean?,
})
return React.createElement(Button, {
LayoutOrder = if props.Disabled then... | 635 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Checkbox.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Checkbox = require("../Components/Checkbox")
local createStory = require("./Helpers/createStory")
local function StoryItem(props: {
LayoutOrder: number,
Value: boolean?,
Label: string,
})
return React.createElement("Frame", {
Size = UDim2.new(0, 200, 0, 50),
... | 449 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/ColorPicker.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local ColorPicker = require("../Components/ColorPicker")
local createStory = require("./Helpers/createStory")
local function StoryItem(props: { Disabled: boolean? })
local color, setColor = React.useState(Color3.fromRGB(255, 255, 0))
return React.createElement(ColorPic... | 142 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/DatePicker.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local DatePicker = require("../Components/DatePicker")
local Label = require("../Components/Label")
local createStory = require("./Helpers/createStory")
local function Story()
local date, setDate = React.useState(DateTime.now())
return React.createElement(React.Fragmen... | 164 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/DropShadowFrame.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Checkbox = require("../Components/Checkbox")
local DropShadowFrame = require("../Components/DropShadowFrame")
local Label = require("../Components/Label")
local createStory = require("./Helpers/createStory")
local function Story()
local boxValue, setBoxValue = Rea... | 322 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Dropdown.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Constants = require("../Constants")
local Dropdown = require("../Components/Dropdown")
local createStory = require("./Helpers/createStory")
local useTheme = require("../Hooks/useTheme")
local classNames = {
"Part",
"Script",
"Player",
"Folder",
"Tool",
"Spawn... | 465 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Helpers/createStory.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local ReactRoblox = require("@pkg/@jsdotlua/react-roblox")
local PluginProvider = require("../../Components/PluginProvider")
local ScrollFrame = require("../../Components/ScrollFrame")
local ThemeContext = require("../../Contexts/ThemeContext")
local getStoryPlugin = requi... | 765 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Helpers/getStoryPlugin.luau | luau | .luau | --!nocheck
--!nolint UnknownGlobal
-- selene: allow(undefined_variable)
local plugin = PluginManager():CreatePlugin()
return function()
return plugin
end
| 38 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Helpers/studiocomponents.storybook.luau | luau | .luau | --!nocheck
local React = require("@pkg/@jsdotlua/react")
local ReactRoblox = require("@pkg/@jsdotlua/react-roblox")
return {
name = "StudioComponents",
storyRoots = {
script.Parent.Parent,
},
packages = {
React = React,
ReactRoblox = ReactRoblox,
},
}
| 78 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Label.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Label = require("../Components/Label")
local createStory = require("./Helpers/createStory")
local styles = {
Enum.StudioStyleGuideColor.MainText,
Enum.StudioStyleGuideColor.SubText,
Enum.StudioStyleGuideColor.TitlebarText,
Enum.StudioStyleGuideColor.BrightText,
... | 429 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/LoadingDots.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local LoadingDots = require("../Components/LoadingDots")
local createStory = require("./Helpers/createStory")
local function Story()
return React.createElement(LoadingDots, {})
end
return createStory(Story)
| 56 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/MainButton.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local MainButton = require("../Components/MainButton")
local createStory = require("./Helpers/createStory")
local function StoryButton(props: {
Text: string?,
HasIcon: boolean?,
Disabled: boolean?,
})
return React.createElement(MainButton, {
LayoutOrder = if props.D... | 636 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/NumberSequencePicker.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local NumberSequencePicker = require("../Components/NumberSequencePicker")
local createStory = require("./Helpers/createStory")
local function Story()
local value, setValue = React.useState(NumberSequence.new({
NumberSequenceKeypoint.new(0.0, 0.00),
NumberSequenceKey... | 257 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/NumericInput.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Constants = require("../Constants")
local NumericInput = require("../Components/NumericInput")
local createStory = require("./Helpers/createStory")
local function StoryItem(props: {
LayoutOrder: number,
Arrows: boolean?,
Slider: boolean?,
})
local value, setValu... | 551 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/ProgressBar.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local ProgressBar = require("../Components/ProgressBar")
local createStory = require("./Helpers/createStory")
local HEIGHT = 14
local function StoryItem(props: {
Value: number,
Max: number?,
Formatter: ((number, number) -> string)?,
LayoutOrder: number,
})
return Re... | 493 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/RadioButton.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local RadioButton = require("../Components/RadioButton")
local createStory = require("./Helpers/createStory")
local function Story()
local value, setValue = React.useState(true)
return React.createElement(React.Fragment, {}, {
Enabled = React.createElement(RadioButto... | 148 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/ScrollFrame.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Constants = require("../Constants")
local ScrollFrame = require("../Components/ScrollFrame")
local createStory = require("./Helpers/createStory")
local numRows = 10
local numCols = 10
local size = Vector2.new(48, 32)
local function StoryRow(props: {
Row: number,
... | 564 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Slider.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Slider = require("../Components/Slider")
local createStory = require("./Helpers/createStory")
local function StoryItem(props: {
LayoutOrder: number,
Disabled: boolean?,
})
local value, setValue = React.useState(3)
return React.createElement(Slider, {
Value = v... | 183 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/Splitter.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local Label = require("../Components/Label")
local Splitter = require("../Components/Splitter")
local createStory = require("./Helpers/createStory")
local useTheme = require("../Hooks/useTheme")
local function StoryItem(props: {
Size: UDim2,
LayoutOrder: number,
Disabl... | 510 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/TabContainer.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local TabContainer = require("../Components/TabContainer")
local createStory = require("./Helpers/createStory")
local function StoryItemContent(props: {
BackgroundColor3: Color3,
})
return React.createElement("Frame", {
Position = UDim2.fromOffset(10, 10),
Size = UD... | 419 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/Stories/TextInput.story.luau | luau | .luau | local React = require("@pkg/@jsdotlua/react")
local TextInput = require("../Components/TextInput")
local createStory = require("./Helpers/createStory")
local function StoryItem(props: {
Label: string,
LayoutOrder: number,
Disabled: boolean?,
Filter: ((s: string) -> string)?,
})
local text, setText = React.useSta... | 336 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/getTextSize.luau | luau | .luau | local TextService = game:GetService("TextService")
local Constants = require("./Constants")
local TEXT_SIZE = Constants.DefaultTextSize
local FONT = Constants.DefaultFont
local FRAME_SIZE = Vector2.one * math.huge
local function getTextSize(text: string)
local size = TextService:GetTextSize(text, TEXT_SIZE, FONT, F... | 97 |
sircfenner/StudioComponents | sircfenner-StudioComponents-ceb9d45/src/init.luau | luau | .luau | return {
Constants = require("./Constants"),
Background = require("./Components/Background"),
Button = require("./Components/Button"),
Checkbox = require("./Components/Checkbox"),
ColorPicker = require("./Components/ColorPicker"),
DatePicker = require("./Components/DatePicker"),
Dropdown = require("./Components... | 251 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/get.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local Matter_0_8 = require(ReplicatedStorage.Matter_0_8)
local Matter_0_9 = require(ReplicatedStorage.Matter_0_9)
local A, B = Matter.component(), Matter.component()
local A_0_8, B_0... | 432 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/insert.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local A, B = Matter.component(), Matter.component()
local pinnedA, pinnedB = PinnedMatter.component(), PinnedMatter.compone... | 244 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/next.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local world = Matter.World.new()
local pinnedWorld = PinnedMatter.World.new()
local A, B = Matter.component(), Matter.comp... | 264 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/query.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local world = Matter.World.new()
local pinnedWorld = PinnedMatter.World.new()
local A, B = Matter.component(), Matter.comp... | 258 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/stress.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local world = Matter.World.new()
local pinnedWorld = PinnedMatter.World.new()
local A, B, C, D, E, F, G =
Matter.componen... | 747 |
matter-ecs/matter | matter-ecs-matter-f31981b/benchmarks/without.bench.luau | luau | .luau | --!optimize 2
--!native
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Matter)
local PinnedMatter = require(ReplicatedStorage.Matter_0_8)
local world = Matter.World.new()
local pinnedWorld = PinnedMatter.World.new()
local A, B, C, D, E, F, G =
Matter.componen... | 639 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/client/systems/roombasHurt.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local Matter = require(ReplicatedStorage.Lib.Matter)
local function roombasHurt(world)
for _, _, model in world:query(Components.Roomba, Components.... | 214 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/client/systems/spinSpinners.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local function spinSpinners(world, _, ui)
if ui.checkbox("Disable Spinning"):checked() then
return
end
local transparency = ui.slider(1)
local randomize = ui.button("Randomize colors!"... | 172 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/game.client.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local start = require(ReplicatedStorage.Shared.start)
local receiveReplication = require(ReplicatedStorage.Client.receiveReplication)
local world, state = start({
ReplicatedStorage.Shared.systems,
ReplicatedStorage.Client.systems,
})
receiveReplication(... | 70 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/init.server.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local start = require(ReplicatedStorage.Shared.start)
local setupTags = require(ReplicatedStorage.Shared.setupTags)
local world = start({
script.systems,
ReplicatedStorage.Shared.systems,
})
setupTags(world)
| 59 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/mothershipsSpawnRoombas.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local Matter = require(ReplicatedStorage.Lib.Matter)
local function mothershipsSpawnRoombas(world)
for id, model, lasering, transform in
world:query(Components.Model, Components.Lasering, C... | 271 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/removeMissingModels.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local Matter = require(ReplicatedStorage.Lib.Matter)
local function removeMissingModels(world)
for id, model in world:query(Components.Model) do
for _ in Matter.useEvent(model.model, "Ances... | 191 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/replication.luau | luau | .luau | local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local useEvent = require(ReplicatedStorage.Lib.Matter).useEvent
local RemoteEvent = Instance.new("RemoteEvent")
RemoteEvent.Name = "MatterRemote"
Rem... | 383 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/roombasMove.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local function roombasMove(world)
local targets = {}
for _, model in world:query(Components.Model, Components.Target) do
table.insert(targets, model.model.PrimaryPart.CFrame.p)
end
for ... | 469 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/server/systems/spawnRoombas.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local function spawnRoombas(world)
for id, _ in world:query(Components.Transform, Components.Roomba):without(Components.Model) do
local model = ReplicatedStorage.Assets.KillerRoomba:Clone()... | 121 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/shared/components.luau | luau | .luau | local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Matter = require(ReplicatedStorage.Lib.Matter)
local COMPONENTS = {
"Roomba",
"Model",
"Charge",
"Health",
"Target",
"Transform",
"Mothership",
"Lasering",
"DebugLabel",
"Spinner",
}
local components = {}
for _, name in ipairs(COMPONENTS)... | 106 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/shared/start.luau | luau | .luau | local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Packages = ReplicatedStorage.Packages
local Matter = require(ReplicatedStorage.Lib.Matter)
local Plasma = require(Packages.plasma)
local HotR... | 572 |
matter-ecs/matter | matter-ecs-matter-f31981b/example/src/shared/systems/updateModelAttribute.luau | luau | .luau | local RunService = game:GetService("RunService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Components = require(ReplicatedStorage.Shared.components)
local name = RunService:IsServer() and "serverEntityId" or "clientEntityId"
local function updateModelAttribute(world)
for id, record in worl... | 103 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/Archetype.luau | luau | .luau | export type EntityId = number
export type ComponentId = number
export type ComponentIds = { ComponentId }
export type Component = { [any]: any }
export type ComponentInstance = { [any]: any }
export type ArchetypeId = string
export type Archetype = {
entities: { EntityId },
componentIds: { ComponentId },
idToIndex... | 278 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/Loop.luau | luau | .luau | local RunService = game:GetService("RunService")
local World = require(script.Parent.World)
local rollingAverage = require(script.Parent.rollingAverage)
local topoRuntime = require(script.Parent.topoRuntime)
local recentErrors = {}
local recentErrorLastTime = 0
local systemNames: { [any]: string } = {}
local functi... | 3,852 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/Queue.luau | luau | .luau | local Queue = {}
Queue.__index = Queue
function Queue.new()
return setmetatable({
_head = nil,
_tail = nil,
}, Queue)
end
function Queue:pushBack(value)
local entry = {
value = value,
next = nil,
}
if self._tail ~= nil then
self._tail.next = entry
end
self._tail = entry
if self._head == nil then
... | 147 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/EventBridge.luau | luau | .luau | local RunService = game:GetService("RunService")
local EventBridge = {}
EventBridge.__index = EventBridge
local debouncedEvents = {
InputChanged = true,
}
local debounce = {}
local function serialize(...)
local first = ...
if first and typeof(first) == "Instance" and first:IsA("InputObject") then
return {
D... | 1,121 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/clientBindings.luau | luau | .luau | local UserInputService = game:GetService("UserInputService")
local CollectionService = game:GetService("CollectionService")
local tags = {
system = "MatterDebuggerTooltip_System",
altHover = "MatterDebuggerTooltip_AltHover",
}
local function getOffset(mousePos: Vector2, tag: string): UDim2
if tag == tags.altHover ... | 370 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/formatTable.luau | luau | .luau | local stringColor = "#dcdcaa"
local numberColor = "#b0c4de"
local keywordColor = "#c586c0"
local dimmedColor = "#808080"
function colorize(value, color)
if type(value) == "number" then
value = string.format("%.1f", value)
end
return `<font color="{color}">{value}</font>`
end
function colorizeMany(color, ...)
l... | 1,158 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/getAllComponentData.luau | luau | .luau | local function getAllComponentData(world, entity: number): { [{ [any]: any }]: { [any]: any } }
local componentToData = {}
local location = world.allEntities[entity]
local archetype = location.archetype
local indexInArchetype = location.indexInArchetype
for index, field in archetype.fields do
local componentId... | 126 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/hookWidgets.luau | luau | .luau | local useCurrentSystem = require(script.Parent.Parent.topoRuntime).useCurrentSystem
local widgets = {
"arrow",
"blur",
"button",
"checkbox",
"error",
"portal",
"row",
"slider",
"spinner",
"window",
"label",
"heading",
"space",
"table",
}
local dummyHandles = {
checkbox = {
clicked = function()
ret... | 454 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/mouseHighlight.luau | luau | .luau | local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local defaultRaycastParams = RaycastParams.new()
defaultRaycastParams.IgnoreWater = true
function getInstanceOnMouse(params: RaycastParams)
local camera = workspace.CurrentCamera
if not camera then
return... | 479 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/ui.luau | luau | .luau | local RunService = game:GetService("RunService")
local rollingAverage = require(script.Parent.Parent.rollingAverage)
local World = require(script.Parent.Parent.World)
local function systemName(system)
local systemFn = if type(system) == "table" then system.system else system
local name = debug.info(systemFn, "n")
... | 2,369 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/codeText.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(text, options)
options = options or {}
local refs = Plasma.useInstance(function(ref)
return create("TextButton", {
[ref] = "label",
BackgroundTransparency = 1,
Text = "",
AutomaticSize = Enum.AutomaticSize.Y,
... | 252 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/container.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(fn, options)
options = options or {}
local padding = options.padding or 5
local refs = Plasma.useInstance(function(ref)
return create("Frame", {
[ref] = "frame",
BackgroundTransparency = 1,
Position = UDim2.new(... | 234 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/errorInspect.luau | luau | .luau | return function(plasma)
return plasma.widget(function(debugger, custom)
local loop = debugger.loop
plasma.window("\xf0\x9f\x92\xa5 Errors", function()
local text, setText = plasma.useState("")
custom.codeText(text)
local items = {}
for index, errorData in loop._systemErrors[debugger.debugSystem] do
... | 267 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/frame.luau | luau | .luau | return function(Plasma)
return Plasma.widget(function()
local refs = Plasma.useInstance(function(ref)
local style = Plasma.useStyle()
local Frame = Instance.new("Frame")
Frame.BackgroundColor3 = style.bg2
Frame.Position = UDim2.new(0.5, 0, 0.5, 0)
Frame.AnchorPoint = Vector2.new(0.5, 0.5)
Frame.Si... | 367 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/hoverInspect.luau | luau | .luau | local formatTableModule = require(script.Parent.Parent.formatTable)
local getAllComponentData = require(script.Parent.Parent.getAllComponentData)
local formatTable = formatTableModule.formatTable
local FormatMode = formatTableModule.FormatMode
return function(plasma)
return plasma.widget(function(world, id, custom)
... | 200 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/link.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(text, options)
options = options or {}
local clicked, setClicked = Plasma.useState(false)
local style = Plasma.useStyle()
local refs = Plasma.useInstance(function(ref)
local colorHover = style.textColor
local darker =... | 619 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/panel.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(children, options)
options = options or {}
Plasma.useInstance(function()
local style = Plasma.useStyle()
local frame = create("Frame", {
Name = "Panel",
BackgroundColor3 = style.bg2,
Position = UDim2.new(0, 0, 0... | 520 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/realmSwitch.luau | luau | .luau | local CollectionService = game:GetService("CollectionService")
return function(Plasma)
local create = Plasma.create
return Plasma.widget(function(options)
local style = Plasma.useStyle()
options = options or {}
local left = options.left
local right = options.right
local isRight = options.isRight
local... | 575 |
matter-ecs/matter | matter-ecs-matter-f31981b/lib/debugger/widgets/selectionList.luau | luau | .luau | return function(Plasma)
local create = Plasma.create
local Item = Plasma.widget(function(text, selected, icon, sideText, barWidth, index)
local clicked, setClicked = Plasma.useState(false)
local rightClicked, setRightClicked = Plasma.useState(false)
local hovered, setHovered = Plasma.useState(false)
local st... | 1,549 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.