enum
Eagle::Anchor
Overview
Where a control sits inside its parent when no container is arranging it. margin
offsets it from that spot, and Fill stretches it to the parent's size minus the margins.
pause = Panel.new(size: v2(300, 200))
pause.anchor = Anchor::Center # stays centered when the window resizes
hud_score = Label.new("0")
hud_score.anchor = Anchor::TopRight
hud_score.margin = Vec4.new(-10, 10, 0, 0) # 10 px in from the corner
Defined in:
eagle/ui/control.crEnum Members
-
TopLeft =
0 -
Top =
1 -
TopRight =
2 -
Left =
3 -
Center =
4 -
Right =
5 -
BottomLeft =
6 -
Bottom =
7 -
BottomRight =
8 -
Fill =
9 -
Stretch to fill the parent, minus margins.
Instance Method Summary
-
#bottom?
Returns
trueif this enum value equalsBottom -
#bottom_left?
Returns
trueif this enum value equalsBottomLeft -
#bottom_right?
Returns
trueif this enum value equalsBottomRight -
#center?
Returns
trueif this enum value equalsCenter -
#factors : Vec2
Where the anchor sits as fractions of the parent size:
(0, 0)is top-left and(1, 1)bottom-right. -
#fill?
Returns
trueif this enum value equalsFill -
#left?
Returns
trueif this enum value equalsLeft -
#right?
Returns
trueif this enum value equalsRight -
#top?
Returns
trueif this enum value equalsTop -
#top_left?
Returns
trueif this enum value equalsTopLeft -
#top_right?
Returns
trueif this enum value equalsTopRight
Instance Method Detail
Where the anchor sits as fractions of the parent size: (0, 0) is top-left and (1, 1) bottom-right.