예제 #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);
            }
        }
예제 #2
0
 public BoundingRectFill(Actor actor, Color color, Depth depthOffset) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.color        = color;
     this.depthOffset  = depthOffset;
 }
예제 #3
0
 public BoundingRectFill(Actor actor, Color color) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.color        = color;
 }
 public DebugIconHoverRenderer(Actor actor) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.hoverable    = RequireComponent <Hoverable>();
 }
예제 #5
0
 public SimplePhysicsBody(Actor actor, BodyType bodyType) : base(actor)
 {
     this.boundingRect        = RequireComponent <BoundingRect>();
     this.bodyType            = bodyType;
     this.collisionsThisFrame = new List <CollideMoment>();
 }
 public BoundedTextureRenderer(Actor actor, Texture2D texture) : base(actor)
 {
     this.boundingRect = RequireComponent<BoundingRect>();
     this.texture = texture;
 }
예제 #7
0
 public SimpleButtonRenderer(Actor actor) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.clickable    = RequireComponent <Clickable>();
 }
예제 #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");
 }
예제 #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);
 }