Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
textRenderStyleGui.addColor(guiOptions, "backgroundColor").onChange(() => {
textRenderStyle.backgroundColor!.r = guiOptions.backgroundColor.r / 255.0;
textRenderStyle.backgroundColor!.g = guiOptions.backgroundColor.g / 255.0;
textRenderStyle.backgroundColor!.b = guiOptions.backgroundColor.b / 255.0;
});
textRenderStyleGui.add(textRenderStyle, "backgroundOpacity", 0.0, 1.0, 0.1);
textRenderStyleGui.add(guiOptions, "fontName").onFinishChange((value: string) => {
textRenderStyle.fontName = value;
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
textRenderStyleGui
.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
})
.onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
textRenderStyleGui
.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps
gui.add(textRenderStyle, "opacity", 0.0, 1.0, 0.01);
gui.addColor(guiOptions, "backgroundColor").onChange(() => {
textRenderStyle.backgroundColor!.r = guiOptions.backgroundColor.r / 255.0;
textRenderStyle.backgroundColor!.g = guiOptions.backgroundColor.g / 255.0;
textRenderStyle.backgroundColor!.b = guiOptions.backgroundColor.b / 255.0;
});
gui.add(textRenderStyle, "backgroundOpacity", 0.0, 1.0, 0.1);
gui.add(guiOptions, "fontName").onFinishChange((value: string) => {
textRenderStyle.fontName = value;
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
gui.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
}).onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
gui.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps
}).onChange((value: string) => {
textRenderStyle.fontVariant = Number(value);
gui.add(textRenderStyle, "opacity", 0.0, 1.0, 0.01);
gui.addColor(guiOptions, "backgroundColor").onChange(() => {
textRenderStyle.backgroundColor!.r = guiOptions.backgroundColor.r / 255.0;
textRenderStyle.backgroundColor!.g = guiOptions.backgroundColor.g / 255.0;
textRenderStyle.backgroundColor!.b = guiOptions.backgroundColor.b / 255.0;
});
gui.add(textRenderStyle, "backgroundOpacity", 0.0, 1.0, 0.1);
gui.add(guiOptions, "fontName").onFinishChange((value: string) => {
textRenderStyle.fontName = value;
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
gui.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
}).onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
gui.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps
}).onChange((value: string) => {
textRenderStyle.fontVariant = Number(value);
textRenderStyleGui.addColor(guiOptions, "backgroundColor").onChange(() => {
textRenderStyle.backgroundColor!.r = guiOptions.backgroundColor.r / 255.0;
textRenderStyle.backgroundColor!.g = guiOptions.backgroundColor.g / 255.0;
textRenderStyle.backgroundColor!.b = guiOptions.backgroundColor.b / 255.0;
});
textRenderStyleGui.add(textRenderStyle, "backgroundOpacity", 0.0, 1.0, 0.1);
textRenderStyleGui.add(guiOptions, "fontName").onFinishChange((value: string) => {
textRenderStyle.fontName = value;
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
textRenderStyleGui
.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
})
.onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(textSample, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
textRenderStyleGui
.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps
textStyleGui.addColor(guiOptions, "backgroundColor").onChange(() => {
textRenderStyle.backgroundColor!.r = guiOptions.backgroundColor.r / 255.0;
textRenderStyle.backgroundColor!.g = guiOptions.backgroundColor.g / 255.0;
textRenderStyle.backgroundColor!.b = guiOptions.backgroundColor.b / 255.0;
});
textStyleGui.add(textRenderStyle, "backgroundOpacity", 0.0, 1.0, 0.1);
textStyleGui.add(guiOptions, "fontName").onFinishChange((value: string) => {
textRenderStyle.fontName = value;
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(applicationCharset, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
textStyleGui
.add(textRenderStyle, "fontStyle", {
Regular: FontStyle.Regular,
Bold: FontStyle.Bold,
Italic: FontStyle.Italic,
BoldItalic: FontStyle.BoldItalic
})
.onChange((value: string) => {
textRenderStyle.fontStyle = Number(value);
assetsLoaded = false;
textCanvas.fontCatalog.loadCharset(applicationCharset, textRenderStyle).then(() => {
assetsLoaded = true;
});
});
textStyleGui
.add(textRenderStyle, "fontVariant", {
Regular: FontVariant.Regular,
AllCaps: FontVariant.AllCaps,
SmallCaps: FontVariant.SmallCaps