Ruler#

Ruler#

Constructor#

Ruler(*[, color, alpha_mode, render_queue])

pygfx.Ruler subclass that adds a rotated axis label.

Properties#

Ruler.cast_shadow

Whether this object casts shadows, i.e. whether it is rendered into a shadow map.

Ruler.children

tuple of children of this object.

Ruler.color

The color of the ruler components.

Ruler.end_pos

The end posision of the ruler, in model space.

Ruler.end_value

The value at the end of the ruler (read-only).

Ruler.geometry

The object's geometry, the data that defines (the shape of) this object.

Ruler.id

An integer id smaller than 2**31 (read-only).

Ruler.label

Axis label.

Ruler.line

The line object that shows the ruler's path.

Ruler.line_width

The width of the line and tickmarks.

Ruler.material

The object's material, the data that defines the appearance of this object.

Ruler.min_tick_distance

The minimal distance between ticks in screen pixels, when using auto-ticks.

Ruler.nonlinear_transform

An optional nonlinear transform, expressed as WGSL shader code, applied to the raw vertex positions.

Ruler.parent

Object's parent in the scene graph (read-only).

Ruler.points

The points object that shows the ruler's tickmarks.

Ruler.receive_shadow

Whether this object receives shadows.

Ruler.render_mask

Ruler.render_order

Per-object rendering priority used to fine-tune the draw order within a render queue.

Ruler.start_pos

The start posision of the ruler, in model space.

Ruler.start_value

The value of the ruler at the start position (i.e. the offset).

Ruler.text

The text object that shows the ruler's tick labels.

Ruler.tick_format

The format to display the tick values.

Ruler.tick_marker

The marker used for the ticks.

Ruler.tick_side

Whether the ticks are on the 'left' or 'right' of the line.

Ruler.tick_size

The size of the tick marker, i.e. the length of the little line segment.

Ruler.ticks

The ticks to show.

Ruler.ticks_at_end_points

Whether to show tickmarks at the end-points.

Ruler.up

Relic of old WorldObjects that aliases with the new transform.up direction.

Ruler.visible

Whether is object is rendered or not.

Methods#

Ruler.add(*objects[, before, keep_world_matrix])

Add child objects.

Ruler.add_event_handler(*args)

Register an event handler.

Ruler.clear(*[, keep_world_matrix])

Removes all children.

Ruler.get_bounding_box()

Axis-aligned bounding box in local model space.

Ruler.get_bounding_sphere()

Bounding Sphere in local model space.

Ruler.get_geometry_bounding_box()

Ruler.get_world_bounding_box()

Axis aligned bounding box in world space.

Ruler.get_world_bounding_sphere()

Bounding Sphere in world space.

Ruler.handle_event(event)

Handle an incoming event.

Ruler.iter([filter_fn, skip_invisible])

Create a generator that iterates over this objects and its children.

Ruler.look_at(target)

Orient the object so it looks at the given position.

Ruler.release_pointer_capture(pointer_id)

Release the pointer capture for the object that was registered to the given pointer_id.

Ruler.remove(*objects[, keep_world_matrix])

Removes object as child of this object.

Ruler.remove_event_handler(callback, *types)

Unregister an event handler.

Ruler.set_pointer_capture(pointer_id, event_root)

Register this object to capture any other pointer events, until release_pointer_capture is called or an pointer_up event is encountered.

Ruler.traverse(callback[, skip_invisible])

Executes the callback on this object and all descendants.

Ruler.update(camera, canvas_size)

Update the ruler.