3.0.2 • Published 1 year ago

@rbxts/gizmo v3.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

About

gizmo is a visual debug library designed for the Roblox game engine.

Usage

API Reference

Types

The following types are supported:

  • point: Position
  • box: Orientation, Size
  • wirebox: Orientation, Size
  • sphere: Position, Radius
  • wiresphere: Position, Radius
  • line: Position, Position
  • arrow: Position, Position
  • ray: Position, Direction

gizmo.\<type>.draw(...) -> void

Renders the gizmo for a single frame

gizmo.\<type>.create(...) -> object

Creates a new object which can be rendered over multiple frames

gizmo.\<type>.createWithStyle(optional_style, ...) -> object

Creates a new object and applies the style

const arrow = Gizmo.arrow.createWithStyle({
  color: new Color3(1, 0, 0),
  scale: 2
}, Vector3.zero, Vector3.one.mul(15));

object.enable() => void

Starts rendering the gizmo

object.disable() => void

Stops rendering the gizmo

object.update(...) => void

Updates the gizmos appearance

object.style

Controls the 'style' of the gizmo

object.setStyle(optional_style) => void

Controls the 'style' of the gizmo

arrow.setStyle({
  alwaysOnTop: true
})

gizmo.style

The global style used by default when creating or drawing a gizmo

Examples

Drawing an arrow frame-by-frame

RunService.PostSimulation.Connect(() => {
  Gizmo.arrow.draw(start, finish);
})

Drawing a ray frame-by-frame with style

RunService.PostSimulation.Connect(() => {
  //allows to apply the style to the temporary object
  Gizmo.arrow.drawWithStyle({
    alwaysOnTop: true,
    color: new Color3(1, 0, 0),
    scale: 2,
  }, start, finish);
})

Drawing an arrow with an object

const arrow = Gizmo.arrow.create(start, finish);
arrow.enable();

RunService.PostSimulation.Connect(() => {
  arrow.update(start, finish);
})
3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.1.0

1 year ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago