longuint
longuint
Rroblox-ts
Created by longuint on 4/27/2025 in #help
Motion resolves immediately
interesting utility type, thanks for letting me know that exists.
14 replies
Rroblox-ts
Created by longuint on 4/27/2025 in #help
Motion resolves immediately
nvm, I added Binding<UDim2> to the size type and that fixed it
14 replies
Rroblox-ts
Created by longuint on 4/27/2025 in #help
Motion resolves immediately
Here is the Frame
import React, { InstanceProps, ReactNode } from "@rbxts/react";
import { Colors } from "shared/util/colors";
import { Rounded } from "./Rounded";

export interface FrameProps {
backgroundTransparency?: number;
backgroundColor?: Color3;
size: UDim2;
position?: UDim2;
anchorPoint?: Vector2;
children?: ReactNode | ReactNode[];
Native?: Partial<InstanceProps<Frame>>;
keyName?: string | number;
cornerRadius?: number;
}

export function Frame(props: FrameProps) {
return (
<frame
BackgroundColor3={props.backgroundColor !== undefined ? props.backgroundColor : Colors.BLACK}
BackgroundTransparency={props.backgroundTransparency ?? 0}
Size={props.size}
Position={props.position}
AnchorPoint={props.anchorPoint}
key={props.keyName ? props.keyName : `frame`}
{...props.Native}
>
<Rounded px={props.cornerRadius ?? 8} />
{props.children}
</frame>
);
}
import React, { InstanceProps, ReactNode } from "@rbxts/react";
import { Colors } from "shared/util/colors";
import { Rounded } from "./Rounded";

export interface FrameProps {
backgroundTransparency?: number;
backgroundColor?: Color3;
size: UDim2;
position?: UDim2;
anchorPoint?: Vector2;
children?: ReactNode | ReactNode[];
Native?: Partial<InstanceProps<Frame>>;
keyName?: string | number;
cornerRadius?: number;
}

export function Frame(props: FrameProps) {
return (
<frame
BackgroundColor3={props.backgroundColor !== undefined ? props.backgroundColor : Colors.BLACK}
BackgroundTransparency={props.backgroundTransparency ?? 0}
Size={props.size}
Position={props.position}
AnchorPoint={props.anchorPoint}
key={props.keyName ? props.keyName : `frame`}
{...props.Native}
>
<Rounded px={props.cornerRadius ?? 8} />
{props.children}
</frame>
);
}
14 replies
Rroblox-ts
Created by longuint on 4/27/2025 in #help
Motion resolves immediately
Should I add .getValue() to the end of that? It's complaining I cannot assign Binding<UDim2> to UDim2
14 replies
Rroblox-ts
Created by longuint on 4/27/2025 in #help
Motion resolves immediately
import { useMusic } from "../composables/use-music";
import { useMotion } from "@rbxts/pretty-react-hooks";
import { usePx } from "../composables/use-px";
import React, { useEffect } from "@rbxts/react";
import { Frame } from "./derived";
import { springs } from "../composables/springs";

export function MusicBanner() {
const music = useMusic();
const [width, widthMotor] = useMotion(0);
const px = usePx();

useEffect(() => {
if (music.isPlaying) {
widthMotor.set(0);
widthMotor.spring(px(400), springs.responsive);
} else {
widthMotor.spring(0, springs.responsive);
}
}, [music.currentTrack, music.isPlaying]);

print(width.getValue());

return (
<Frame
size={UDim2.fromOffset(width.getValue(), px(75))}
anchorPoint={new Vector2(0.5, 0.5)}
position={new UDim2(0.5, 0, 0, 75)}
/>
);
}
import { useMusic } from "../composables/use-music";
import { useMotion } from "@rbxts/pretty-react-hooks";
import { usePx } from "../composables/use-px";
import React, { useEffect } from "@rbxts/react";
import { Frame } from "./derived";
import { springs } from "../composables/springs";

export function MusicBanner() {
const music = useMusic();
const [width, widthMotor] = useMotion(0);
const px = usePx();

useEffect(() => {
if (music.isPlaying) {
widthMotor.set(0);
widthMotor.spring(px(400), springs.responsive);
} else {
widthMotor.spring(0, springs.responsive);
}
}, [music.currentTrack, music.isPlaying]);

print(width.getValue());

return (
<Frame
size={UDim2.fromOffset(width.getValue(), px(75))}
anchorPoint={new Vector2(0.5, 0.5)}
position={new UDim2(0.5, 0, 0, 75)}
/>
);
}
14 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
So would it be:
export function SceneCode(config: SceneCodeConfig) {
return (ctor: object, name: string) => {
ManimRegistry.addSceneCode(name, ctor as () => void);
}
}
export function SceneCode(config: SceneCodeConfig) {
return (ctor: object, name: string) => {
ManimRegistry.addSceneCode(name, ctor as () => void);
}
}
?
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
Sorry for the ping but I'm confused how I should go about implementing this. I want it so that functions annotated with @SceneCode() in any class with the @Manim.Decorators.Scene() annotation are added to a registry where they can all be called.
import { Manim } from "@rbxts/manim";
import { BaseScene } from "../../scene";
import { SceneCode } from "../../decorators/scene-code";

@Manim.Decorators.Scene({
name: "ColorSpace",
enabled: true,
deleteOnFinish: false,
})
export class ColorSpace extends BaseScene {
@SceneCode({})
public construct(): void {
print("Hello from ColorSpace");
}
}
import { Manim } from "@rbxts/manim";
import { BaseScene } from "../../scene";
import { SceneCode } from "../../decorators/scene-code";

@Manim.Decorators.Scene({
name: "ColorSpace",
enabled: true,
deleteOnFinish: false,
})
export class ColorSpace extends BaseScene {
@SceneCode({})
public construct(): void {
print("Hello from ColorSpace");
}
}
--
import { MANIM_GLOBAL } from "../global";
import { ManimRegistry } from "../registry";

export interface SceneCodeConfig {}

export function SceneCode(config: SceneCodeConfig) {
// I don't know how to access the methods...
}
import { MANIM_GLOBAL } from "../global";
import { ManimRegistry } from "../registry";

export interface SceneCodeConfig {}

export function SceneCode(config: SceneCodeConfig) {
// I don't know how to access the methods...
}
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
Yeah I'm refactoring away from flamework right now, thanks for the help.
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
-- Compiled with roblox-ts v3.0.0
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Modding = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@flamework", "core", "out").Modding
local addScene = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src", "registry").addScene
local Scene = Modding.createDecorator("Class", function(descriptor, config)
local _result = config[1]
if _result ~= nil then
_result = _result.name
end
addScene(_result, config[1])
end)
return {
Scene = Scene,
}
-- Compiled with roblox-ts v3.0.0
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Modding = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@flamework", "core", "out").Modding
local addScene = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src", "registry").addScene
local Scene = Modding.createDecorator("Class", function(descriptor, config)
local _result = config[1]
if _result ~= nil then
_result = _result.name
end
addScene(_result, config[1])
end)
return {
Scene = Scene,
}
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
the base scene file?
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
Yeah, probably not. I can just do the functionality through a registry.
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
I could probably do that. I just like the lifecycle systems in flamework
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
I'm trying to use flamework's decorators in my package
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
Line 25 it says
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
import { Modding } from "@flamework/core";
import { BaseSceneAttributes } from "../scene";
import { addScene } from "../registry";

export const Scene = Modding.createDecorator<[BaseSceneAttributes]>("Class", (descriptor, config) => {
addScene(config[0]?.name, config[0]);
});
import { Modding } from "@flamework/core";
import { BaseSceneAttributes } from "../scene";
import { addScene } from "../registry";

export const Scene = Modding.createDecorator<[BaseSceneAttributes]>("Class", (descriptor, config) => {
addScene(config[0]?.name, config[0]);
});
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
Yeah I have
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value
And this is the emitted luau
-- Compiled with roblox-ts v3.0.0
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Manim = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src").Manim
local BaseScene = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src", "scene").BaseScene
local ColorSpace
do
local super = BaseScene
ColorSpace = setmetatable({}, {
__tostring = function()
return "ColorSpace"
end,
__index = super,
})
ColorSpace.__index = ColorSpace
function ColorSpace.new(...)
local self = setmetatable({}, ColorSpace)
return self:constructor(...) or self
end
function ColorSpace:constructor(...)
super.constructor(self, ...)
end
function ColorSpace:construct()
print("Hello from ColorSpace")
end
ColorSpace = Manim.Decorators.Scene({
name = "ColorSpace",
enabled = true,
deleteOnFinish = false,
})(ColorSpace) or ColorSpace
end
return {
ColorSpace = ColorSpace,
}
-- Compiled with roblox-ts v3.0.0
local TS = require(game:GetService("ReplicatedStorage"):WaitForChild("rbxts_include"):WaitForChild("RuntimeLib"))
local Manim = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src").Manim
local BaseScene = TS.import(script, game:GetService("ReplicatedStorage"), "rbxts_include", "node_modules", "@rbxts", "manim", "src", "scene").BaseScene
local ColorSpace
do
local super = BaseScene
ColorSpace = setmetatable({}, {
__tostring = function()
return "ColorSpace"
end,
__index = super,
})
ColorSpace.__index = ColorSpace
function ColorSpace.new(...)
local self = setmetatable({}, ColorSpace)
return self:constructor(...) or self
end
function ColorSpace:constructor(...)
super.constructor(self, ...)
end
function ColorSpace:construct()
print("Hello from ColorSpace")
end
ColorSpace = Manim.Decorators.Scene({
name = "ColorSpace",
enabled = true,
deleteOnFinish = false,
})(ColorSpace) or ColorSpace
end
return {
ColorSpace = ColorSpace,
}
34 replies
Rroblox-ts
Created by longuint on 3/2/2025 in #help
Attempt to call a table value

12:06:19.187 ServerScriptService.TS.scenes.color-space:25: attempt to call a table value - Server - color-space:25
12:06:19.187 Stack Begin - Studio
12:06:19.187 Script 'ServerScriptService.TS.scenes.color-space', Line 25 - Studio - color-space:25
12:06:19.187 Stack End - Studio

12:06:19.187 ServerScriptService.TS.scenes.color-space:25: attempt to call a table value - Server - color-space:25
12:06:19.187 Stack Begin - Studio
12:06:19.187 Script 'ServerScriptService.TS.scenes.color-space', Line 25 - Studio - color-space:25
12:06:19.187 Stack End - Studio
This is the output in studio
34 replies