Skip to content

Extending graphics off screen #2772

Answered by eonarheim
davobutt asked this question in Q&A
Sep 29, 2023 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

@davobutt Great question! I think you found a bug with Lines!

After digging into this, there is a zero dimension bound when creating horizontal lines (if the line is slightly askew the bound is non zero). In the case of longBeam it's bound is 1001x0. That zero height is playing havoc with the offscreen culling routine and causing it to think it's offscreen when it really isn't.

I've created an issue and should be able to work this soon!

To workaround this you can manually set a height on the line longLine.height = 26 or make the line slightly askew:

class Beam extends ex.Actor {
  public length;

  constructor(options, length) {
    super(options);
    this.graphics.anchor = ex.Vector.Zero;

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@eonarheim
Comment options

@davobutt
Comment options

Answer selected by davobutt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
3 participants