Increase the Button Slider response area

Button
requirement: use an image as a button, want to expand the response area of ​​the button but do not want to change the size of the image
Solution: You can set the image as a separate node as a child node of the Button, and then set the Target Graphic of the Button to image, at this time Adjusting the size of the Button can change the response area.

Plain text Button
Button does not have an image component, you can set the Button's Target Graphic to Text to realize changes such as text color highlighting

Slider
requirements: adjust the dragging area so that dragging can also be responded to outside the visible area of ​​​​the ui, that is, insert image description here
this place can also be dragged
Solution: hang an image on the Slider, the color is transparent, just change the size of the Slider, and pay attention to maintaining the size of the ui , need to adjust

Notes extracted from https://linxinfa.blog.csdn.net/article/details/119912971?spm=1001.2014.3001.5502

Guess you like

Origin blog.csdn.net/baidu_38392815/article/details/124951847