Skip to content

Correct way to sustain Origin behaviour while having transformations applied from a different axis #6431

Answered by smoogipoo
approachcircle asked this question in Q&A
Discussion options

You must be logged in to vote

Code for reference: https://github.com/approachcircle/Blackjack/blob/511fdd33c827d438528ce0f24073a59f81131659/Blackjack/Blackjack.Game/FlashingButton.cs

As far as I can gather, the issue is related to autosize. When the flashing box comes visible, it starts contributing to the autosize layout of the button causing it to become bigger as a whole.

The best guidance I have to fix this is to prefer RelativeSizeAxes when possible and move the masking to an inner layer, as so:

public partial class BlackjackButton : ClickableContainer
     private void load()
     {
         disabledColour = Colour4.DarkGray.Darken(1);
-        Masking = true;
-        CornerRadius = 5;
-        AutoSizeAxes = A…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@approachcircle
Comment options

@smoogipoo
Comment options

@approachcircle
Comment options

@smoogipoo
Comment options

@approachcircle
Comment options

Answer selected by approachcircle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants