ForceUpdatedependencies
Introduction
Common Usage
Code Example - Modifying child relative values
using FlatRedBall.Graphics; Text firstText = TextManager.AddText("");
Text secondText = TextManager.AddText("");
PositionedObject parent = new PositionedObject();
firstText.AttachTo(parent, false);
secondText.AttachTo(parent, false);
firstText.RelativeY = 2;
secondText.RelativeY = -2;
// At this point the relative values have not
// yet been applied to change absolute values.
// Calling ForceUpdateDependencies forces an update
// resulting in the absolute Y value changing.
firstText.ForceUpdateDependencies();
// Now set the DisplayText to show if they've been changed
firstText.DisplayText = "My Y in Initialize is: " + firstText.Y;
secondText.DisplayText = "My Y in Initialize is: " + secondText.Y;
Code Example - Modifying parent absolute values

Last updated
Was this helpful?