Loading different svg images in animation
Is your improvement request related to a problem? Please describe. I'm always frustrated when I am making an animation component, in which I would like to load different svg images depending on different conditions in the component. For instance, if I am making a trajectory display component for a vehicle, and I want to allow the user to choose what vehicle to display (e.g. car, plane or boat), I am forced to load all images and scale those I do not want to show to 0. In the case of showing multiple vehicles, the problem becomes even larger
Describe the solution you'd like I would like the animation to load different svg icon files depending on what I choose, so that I do not need to show all icons at the same time. For instance, it would be convenient to just add one row in the xml file with a new svg icon, and then depending on what I have chosen it will load the desired image and move it accordingly
It could be possible to have multiple icons for each movable, and loading only one of them before animation starts depending on a parameter value. It would of course assume that the icon does not change during animation.
There is already an XML tag with the kind of misleading name "indicator", see e.g. SignalAnimtionLamp component. It will show or hide the specific movable depending on the value of a specified data variable (visible if value > 0.5). You still need one movable for each icon, but at least you don't need to scale them to zero.
Yes, the "indicator" tag seems to do the trick. It would be nice also if it was possible to have a tag with several thresholds (e.g. 0.1 0.2 0.3 .. ), so that different icons are shown depending on one variable. For instance, if I want to move an object and this object could be either a car, a boat or a plane, I now need to define one unique variable (between 0 and 1) for each icon. With several thresholds one variable can be used to determine which icon to show.