コード例 #1
0
ファイル: BoundedCanvas.cs プロジェクト: notexplosive/machina
        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;
 }
コード例 #4
0
 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>();
 }
コード例 #6
0
 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>();
 }
コード例 #10
0
 public BoundingRectToViewportSize(Actor actor) : base(actor)
 {
     this.boundingRect = RequireComponent <BoundingRect>();
     this.boundingRect.SetSize(this.actor.scene.sceneLayers.gameCanvas.ViewportSize);
 }