Ejemplo n.º 1
0
        public BoundedCanvas(Actor actor) : base(actor)
        {
            this.DrawAdditionalContent += spriteBatch =>
            {
                if (Runtime.DebugLevel > DebugLevel.Passive)
                {
                    spriteBatch.Begin();
                    spriteBatch.DrawRectangle(new Rectangle(5, 5, 10, 10), Color.Red, 1, this.actor.transform.Depth);
                    spriteBatch.DrawRectangle(new Rectangle(10, 10, 10, 10), Color.Red, 1, this.actor.transform.Depth);
                    spriteBatch.End();
                }
            };

            this.boundingRect = RequireComponent <BoundingRect>();
            this.boundingRect.onSizeChange += BuildRenderTarget;

            if (this.boundingRect.Area > 0)
            {
                BuildRenderTarget(this.boundingRect.Size);
            }
        }
Ejemplo n.º 2
0
 public BoundingRectFill(Actor actor, Color color, Depth depthOffset) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.color        = color;
     this.depthOffset  = depthOffset;
 }
Ejemplo n.º 3
0
 public BoundingRectFill(Actor actor, Color color) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.color        = color;
 }
Ejemplo n.º 4
0
 public DebugIconHoverRenderer(Actor actor) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.hoverable    = RequireComponent <Hoverable>();
 }
Ejemplo n.º 5
0
 public SimplePhysicsBody(Actor actor, BodyType bodyType) : base(actor)
 {
     this.boundingRect        = RequireComponent <BoundingRect>();
     this.bodyType            = bodyType;
     this.collisionsThisFrame = new List <CollideMoment>();
 }
Ejemplo n.º 6
0
 public BoundedTextureRenderer(Actor actor, Texture2D texture) : base(actor)
 {
     this.boundingRect = RequireComponent<BoundingRect>();
     this.texture = texture;
 }
Ejemplo n.º 7
0
 public SimpleButtonRenderer(Actor actor) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.clickable    = RequireComponent <Clickable>();
 }
Ejemplo n.º 8
0
 public LayoutElement(Actor actor) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.parentGroup  = this.actor.GetComponentInImmediateParent <LayoutGroup>();
     Debug.Assert(this.parentGroup != null, "LayoutElement does not have a LayoutGroup parent");
 }
Ejemplo n.º 9
0
 public BoundingRectRenderer(Actor actor) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
 }
 public BoundingRectToViewportSize(Actor actor) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.boundingRect.SetSize(this.actor.scene.sceneLayers.gameCanvas.ViewportSize);
 }