Toggle Vertical

Can I use the Toggle component to create a vertical toggle like the one in the attached graphic? Alternatively, I think I could perhaps use a button with toggle:true and custom graphics using backing:makeShape().
ToggleVertical

That is not built in... but you could rotate the toggle .rot(-90) and use a custom Label - that would be the easiest.

Good idea.
How can I mov the label?
toggle_v2

let myToogleLabel:Label = new Label({
	text: "On\nOff",
	backgroundColor: "#f00"
});
myToogleLabel.rot(90).mov(200,80); // mov will not be executed
myToggle = new Toggle({
	label: myToogleLabel
})
myToggle.x = 100;
myToggle.y = 500;
myToggle.rot(-90);
myToggle.addTo(container)

myToggle.label.mov(30,20); or whatever...

1 Like