Export markers¶
export ¶
export(value: Any) -> _ExportMarker
Mark a script attribute as editable in the inspector using the default widget for its type.
Example
name = export("Goblin")
hp = export(100)
For customizable export, use the appropriate export function: export_range, export_color_picker
export_range ¶
export_range(value: Any, min: SupportsFloat | SupportsIndex = ..., max: SupportsFloat | SupportsIndex = ..., slider: bool = False, prefix: str = '', suffix: str = '') -> _ExportMarker
Mark a script attribute as editable within a min/max range. Shown as a bounded slider by default; pass slider=False for a plain input field that still applies min/max (and any prefix/suffix).
Example
speed = export_range(200.0, 0.0, 500.0)
hp = export_range(100, 0, 999, slider=False, suffix=" hp")
export_drag ¶
export_drag(value: Any, min: SupportsFloat | SupportsIndex = 0.0, max: SupportsFloat | SupportsIndex = 0.0, prefix: str = '', suffix: str = '') -> _ExportMarker
Mark a script attribute as editable with a click-and-drag field. min=max=0 (the default) means unbounded.
Example
jump_force = export_drag(15.0)
ammo = export_drag(30, 0, 999)
export_angle_slider ¶
export_angle_slider(value: Any, min_degrees: SupportsFloat | SupportsIndex = -360.0, max_degrees: SupportsFloat | SupportsIndex = 360.0) -> _ExportMarker
Mark a float script attribute (stored in radians) as editable with an angle slider displayed in degrees.
Example
facing = export_angle_slider(0.0)
cone_angle = export_angle_slider(0.5, 0.0, 180.0)
export_color_edit ¶
export_color_edit(value: Any) -> _ExportMarker
Mark a Vector3 or Vector4 script attribute as editable with a color swatch that opens a picker popup.
Example
tint = export_color_edit(Vector4(1, 1, 1, 1))
export_color_picker ¶
export_color_picker(value: Any) -> _ExportMarker
Mark a Vector3 or Vector4 script attribute as editable with a full color picker always shown inline.
Example
glow_color = export_color_picker(Vector3(0.2, 0.8, 1.0))
export_file ¶
export_file(value: Any, extension: str = '*.*') -> _ExportMarker
Mark a str script attribute as editable with a file picker that stores a res:// virtual path. Clicking opens a file dialog; files can also be dragged in from the resource browser. extension filters which files are shown/accepted, using ';'-separated glob patterns.
Example
icon = export_file("", "*.png;*.jpg;*.jpeg")
export_scene ¶
export_scene(value: Any) -> _ExportMarker
Mark a str script attribute as editable with a file picker restricted to .fscene files, storing a res:// virtual path.
Example
next_level = export_scene("res://levels/level_2.fscene")
export_section ¶
export_section(name: str) -> typing.Any
Create a collapsible inspector section. All exported properties following this marker are displayed inside the section until another section marker is encountered. Can be used as a bare statement.
Example
export_section("Visuals")
color = export_color_edit(Vector4(1, 1, 1, 1))
export_sub_section ¶
export_sub_section(name: str) -> typing.Any
Create a collapsible inspector sub-section, nested inside whichever export_section is currently open (or at the top level if none is). Properties following this marker are displayed inside it until another section or sub-section marker is encountered. Can be used as a bare statement.
Example
export_section("Movement")
speed = export(5.0)
export_sub_section("Advanced")
acceleration_curve = export(1.0)