ModraUp Ruby API Documentation Ruby API Reference

Class: ModraUp::RenderingOptionsObserver

Inherits:
Object
  • Object
show all

Overview

Base class for drawing option observers. Register using ModraUp::RenderingOptions#add_observer.

Examples:

ModraUp::RenderingOptionsObserver.new

Instance Method Summary # collapse

Instance Method Details

observer.onRenderingOptionsChanged(rendering_options, type) ⇒ nil

Called when a rendering option's value changes (does not dispatch if the value remains the same). type is one of the ModraUp::RenderingOptions::ROP… constants, with the same numerical value as in SketchUp (e.g., ROPSetModelTransparency is 42). Changes in the Styles panel do not dispatch.

Parameters:

  • rendering_options (ModraUp::RenderingOptions)
  • type (Integer)

Returns:

  • (nil)

Examples:

class MyRO < ModraUp::RenderingOptionsObserver
  def onRenderingOptionsChanged(opts, type)
    puts "x-ray" if type == ModraUp::RenderingOptions::ROPSetModelTransparency
  end
end