ControllerImage icon indicating copy to clipboard operation
ControllerImage copied to clipboard

Feature Request: Draw Button/Axis "Variants"

Open ShockSlayer opened this issue 1 year ago • 1 comments

Presently, each button/axis is only represented by a single image. I think it would be reasonable to pass an extra value to allow drawing variant states. For buttons, this would probably just amount to drawing a "pressed" variant, while for an axis this would be along the lines of drawing an up/down/left/right/none version.

Basically, I think having a way to use a few more of these already-drawn variants would greatly elevate the utility of the library: preview-xbox-series

ShockSlayer avatar May 17 '24 01:05 ShockSlayer

I've got this working locally, by making the arrays in ControllerImage_Device 2D, and by adding/splitting text off of the svg filenames using an underscore as a delimiter; ie rightshoulder.svg becomes rightshoulder_0.svg and so on. If a variant is requested and not found, the default variant of 0 is used instead.

If this design philosophy makes sense for the project, I wouldn't mind creating a pull request, although I am a little less than confident about the implementation given that C-style string manipulation is not my forte. I'd also like to get a full example theme set up first, which will take a little bit of time to complete.

ShockSlayer avatar May 19 '24 04:05 ShockSlayer