Use the Slider 3D node as a building block for a 3D UI control that lets the application user change a numerical value using a visual indicator between a minimum and a maximum value.
More...
Use the Slider 3D node as a building block for a 3D UI control that lets the application user change a numerical value using a visual indicator between a minimum and a maximum value.
To disable a Slider 3D node, set the Node::EnabledProperty to false. A disabled Slider 3D does not respond to input. To visually indicate the disabled state of a Slider 3D node, create a state manager and use the Node::EffectivelyEnabledProperty as its controller property. When Kanzi disables a Slider 3D node, it cancels current gestures and preserves the slider value.
Examples
To create a Slider 3D node with a custom appearance:
scene->addChild(slider3d);
slider3d->setWidth(4.0f);
slider3d->setHeight(2.0f);
slider3d->setDepth(1.0f);
Model3DSharedPtr sliderKnob = Model3D::createSphere(domain,
"Slider knob", 1.0f, 20, 20, ThemeBlue);
trajectoryLayout->addChild(sliderKnob);
slider3d->addChild(trajectoryLayout);
sliderKnob->setBinding(binding, TrajectoryLayout3D::OverrideOffsetProperty, PropertyFieldWhole);
ResourceID alias("$layout");
string path("obj:///" + trajectoryLayout->getName());
slider3d->addResource(alias, path);
TrajectorySharedPtr trajectory = Trajectory::createLine(Vector3(), Vector3(1.0f, 0.0f, 0.0f), 5.0f, domain,
"Line trajectory");
trajectoryLayout->setTrajectory(trajectory);
trajectoryLayout->setHorizontalAlignment(Node::HorizontalAlignmentStretch);
trajectoryLayout->setVerticalAlignment(Node::VerticalAlignmentStretch);
trajectoryLayout->setDepthAlignment(Node::DepthAlignmentStretch);