Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScreenAppender logger appears to be broken #2886

Closed
eonarheim opened this issue Jan 14, 2024 · 1 comment · Fixed by #2935
Closed

ScreenAppender logger appears to be broken #2886

eonarheim opened this issue Jan 14, 2024 · 1 comment · Fixed by #2935
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior

Comments

@eonarheim
Copy link
Member

Steps to Reproduce

var game = new ex.Engine({
  width: 1000,
  height: 1000
});

const player1 = new ex.Actor({
  name: "player",
  width: 25,
  height: 25,
  color: ex.Color.Red,
  pos: new ex.Vector(15, 15),
});

let screenLog = new ex.ScreenAppender(300, 400);

ex.Logger.getInstance().addAppender(screenLog);

//player1.enableCapturePointer = true;
console.log(player1);

let subscr = player1.on("pointerdown", pe => {
  ex.Logger.getInstance().info("pointer event: ", pe);
  console.log("pointer event: ", pe);

  if (player1.hasTag("bound")) player1.removeTag("bound");
  else player1.addTag("bound");
});
console.log(subscr);

game.input.pointers.on("move", pe => {
  //Logger.getInstance().info("pointer event: ", pe);

  if (player1.hasTag("bound")) {
    console.log("bound actor");
  }
});

game.add(player1);

game.start();

Expected Result

Should log to the screen

Actual Result

Nothing logged

Environment

  • browsers and versions: Latest chrome
  • operating system: Windows
  • Excalibur versions: v0.28.6

Current Workaround

None :(

@jyoung4242
Copy link
Contributor

image

i was able to move the screenappender canvas 'manually' to top left

and get it to show data sent to it

issue is position absolute and lack of top/left css properties

@eonarheim eonarheim added the bug This issue describes undesirable, incorrect, or unexpected behavior label Feb 16, 2024
eonarheim added a commit that referenced this issue Feb 17, 2024
Closes: #2886

Fixes an issue spotted by @jyoung4242 where `ScreenAppenders` did not work properly. They are now also more configurable!


https://github.com/excaliburjs/Excalibur/assets/612071/9f971648-db2f-4958-bcb8-606c00c234ce



```typescript
const logger = Logger.getInstance();
const screenAppender = new ScreenAppender({
    engine: game,
    color: Color.Black,
    xPos: 0
});
logger.addAppender(screenAppender);
setInterval(() => {
    logger.info('test', performance.now());
}, 100);
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants