OEAddSVGToggle¶
bool OEAddSVGToggle(OESVGGroup *area, OESVGGroup *target, bool on = false)
Adds a toggle effect to the objects drawn between the two given groups. When clicking on the objects drawn inside the area group the objects drawn in the target group appear / disappear.
- on
The parameter that determine whether the objects drawn inside the target group are displayed initially.
Note
This functionality is only available for .svg
image format.
See also
OESVGGroup class
OEAddSVGClickEvent
functionOEAddSVGHover
function
Example:
OESVGGroup* toggle_area = image.NewSVGGroup("toggle_area");
OESVGGroup* target_area = image.NewSVGGroup("toggle_target_area");
OEAddSVGToggle(toggle_area, target_area);
image.PushGroup(toggle_area);
image.DrawRectangle(OE2DPoint(30, 30), OE2DPoint(70, 70), OERedBoxPen);
image.PopGroup(toggle_area);
image.PushGroup(target_area);
image.DrawCircle(OE2DPoint(150, 50), 30, OEBlueBoxPen);
image.PopGroup(target_area);
OEAddInteractiveIcon(image);
OEWriteImage("AddSVGToggle.svg", image);
Download code
Hint
The OEAddSVGToggle
function should always be called
prior to pushing / popping the OESVGGroup objects.
click on the red rectangle below
Example of using the OEAddSVGToggle function