Skip to main content

Interface: CodeOptions

Defined in: mobjects/text/Code.ts:23

Options for creating a Code mobject

Properties

backgroundPadding?

optional backgroundPadding: number

Defined in: mobjects/text/Code.ts:41

Background padding in pixels. Default: 16


backgroundRadius?

optional backgroundRadius: number

Defined in: mobjects/text/Code.ts:43

Background corner radius in pixels. Default: 8


code

code: string

Defined in: mobjects/text/Code.ts:25

The code string to display


colorScheme?

optional colorScheme: CodeColorScheme

Defined in: mobjects/text/Code.ts:37

Color scheme for syntax highlighting


fontFamily?

optional fontFamily: string

Defined in: mobjects/text/Code.ts:35

Font family. Default: 'monospace'


fontSize?

optional fontSize: number

Defined in: mobjects/text/Code.ts:33

Font size in pixels. Default: 24


language?

optional language: string

Defined in: mobjects/text/Code.ts:27

Programming language for syntax highlighting


lineHeight?

optional lineHeight: number

Defined in: mobjects/text/Code.ts:45

Line height multiplier. Default: 1.4


lineNumbers?

optional lineNumbers: boolean

Defined in: mobjects/text/Code.ts:29

Whether to show line numbers. Default: true


showBackground?

optional showBackground: boolean

Defined in: mobjects/text/Code.ts:39

Whether to show background rectangle. Default: true


tabWidth?

optional tabWidth: number

Defined in: mobjects/text/Code.ts:31

Tab width in spaces. Default: 4