public SpriteData(Matrix4 localTransform, int textureId, Color color, ClipWindow clipArea) { this.LocalTransform = localTransform; this.TextureId = textureId; this.Color = new Color4(color.R, color.G, color.B, color.A); this.ClipArea = clipArea; }
public void Recalculate() { if (this.parentPosition == null && this.positioners.Count > 0) { return; } while (this.calculationGate.TryEnter()) { var oldCenter = this.Center; var oldSize = this.Size; var oldClipArea = this.ClipArea; foreach (var positioner in this.positioners) { positioner.Recalculate(this, this.parentPosition); } if (this.parentPosition != null) { this.ClipArea = new ClipWindow(this.Center, this.Size, this.parentPosition.ClipArea); } else { this.ClipArea = new ClipWindow(this.Center, this.Size); } if (this.Center != oldCenter || this.Size != oldSize || this.ClipArea != oldClipArea) { this.OnReposition(); } } this.calculationGate.Finish(); }
public SpriteData(Matrix4 localTransform, int textureId, Color color, ClipWindow clipArea, bool linearFiltering) { this.LocalTransform = localTransform; this.TextureId = textureId; this.Color = new Color4(color.R, color.G, color.B, color.A); this.ClipArea = clipArea; this.LinearFiltering = linearFiltering; }
public void Recalculate(ElementPosition parentPosition) { foreach (var positioner in this.positioners) { positioner.Recalculate(this, parentPosition); } if (parentPosition != null) { this.ClipArea = new ClipWindow(this.Center, this.Size, parentPosition.ClipArea); } else { this.ClipArea = new ClipWindow(this.Center, this.Size); } }
public SdfData(Matrix4 localTransform, int textureId, Color color, float smoothDist, ClipWindow clipArea) { this.LocalTransform = localTransform; this.TextureId = textureId; this.Color = new Color4(color.R, color.G, color.B, color.A); this.ClipArea = clipArea; this.SmoothDist = Methods.Clamp(smoothDist, 0, 0.5f); }
public ElementPosition(Func <Vector2> contentSize) { this.contentSize = contentSize; this.ClipArea = new ClipWindow(); }