engine icon indicating copy to clipboard operation
engine copied to clipboard

Should buttons tints affect children entities too?

Open yaustar opened this issue 5 years ago • 4 comments

Currently, the tints on the button component do not affect children (e.g the text) which seems odd. This can make fading the button on hover, click etc difficult.

image

Example here when clicking: https://playcanvas.com/editor/scene/1034629

I think that the children should be affected like the Image Element Group Type.

yaustar avatar Nov 17 '20 12:11 yaustar

Both paths are valid, I think during discussion of affecting children or not, we choose not to, which is similar the way background-color works in CSS. There are situations where tinting/alpha propagation would be useful, as well as cases where it is not. Although propagating values down, can complicate internals.

Maksims avatar Nov 17 '20 13:11 Maksims

I think tinting on the image element shouldn't affect children (unless it's a group type). That makes sense to me.

Buttons I argue it should as you are tinting the whole button element which would include it's children

yaustar avatar Nov 17 '20 14:11 yaustar

Some hidden rules of propagating/non propagating, would probably confuse users. But having a checkbox "propagate" for certain properties, probably would make sense.

Maksims avatar Nov 17 '20 15:11 Maksims

This feature would be useful for me too.

albertvanveen avatar Aug 19 '22 10:08 albertvanveen