diff --git a/src/AbstractPlotting.jl b/src/AbstractPlotting.jl index 7f56cd63e..849597105 100644 --- a/src/AbstractPlotting.jl +++ b/src/AbstractPlotting.jl @@ -129,6 +129,7 @@ export textslider # gui export slider, button, playbutton +export move! # Raymarching algorithms export RaymarchAlgorithm, IsoValue, Absorption, MaximumIntensityProjection, AbsorptionRGBA, IndexedAbsorptionRGBA diff --git a/src/camera/camera2d.jl b/src/camera/camera2d.jl index 1e7026d86..85dd7bb09 100644 --- a/src/camera/camera2d.jl +++ b/src/camera/camera2d.jl @@ -2,7 +2,7 @@ struct Camera2D <: AbstractCamera area::Node{FRect2D} zoomspeed::Node{Float32} zoombutton::Node{ButtonTypes} - panbutton::Node{ButtonTypes} + panbutton::Node{Union{ButtonTypes, Vector{ButtonTypes}}} padding::Node{Float32} last_area::Node{Vec{2, Int}} update_limits::Node{Bool} @@ -19,7 +19,7 @@ function cam2d!(scene::SceneLike; kw_args...) area = node(:area, FRect(0, 0, 1, 1)), zoomspeed = 0.10f0, zoombutton = nothing, - panbutton = Mouse.left, + panbutton = Mouse.right, selectionbutton = (Keyboard.space, Mouse.left), padding = 0.001, last_area = Vec(size(scene)), diff --git a/src/interaction/gui.jl b/src/interaction/gui.jl index 290cc69d2..0d256f5b5 100644 --- a/src/interaction/gui.jl +++ b/src/interaction/gui.jl @@ -30,10 +30,17 @@ julia> -5:5 .|> exp .|> sig_printer sig_printer(v::Real) = @sprintf "%0.2e" v """ - Slider + slider(range; kwargs...) -TODO add function signatures -TODO add description +Creates a slider which slides through the selected range; sliders are discrete. +The Slider's value can be accessed through its `value` field. For example: + +```julia +scene = slider(1:10) +lift(scene[end].value) do val + # your function here +end +``` ## Theme $(ATTRIBUTES) @@ -166,13 +173,20 @@ function move!(x::Slider, idx::Integer) return end -export move! - """ - Button + button(text) -TODO add function signatures -TODO add description +Creates a button which can be clicked. +On click, the button increments its `clicks` field by one. + +For example: + +```julia +scene = button("click me please") +lift(scene[end].clicks) do clicks + # your function here +end +``` ## Theme $(ATTRIBUTES)