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

bug: slice9 size setting #602

Open
juneaucross opened this issue Jan 31, 2025 · 0 comments
Open

bug: slice9 size setting #602

juneaucross opened this issue Jan 31, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@juneaucross
Copy link
Contributor

Describe the bug

If 9sliced sprites must be rendered at the first frame after loading, defining size by setting .height and .width is not applying to them.

This won't work:

k.loadSprite('mainMenu', 'sprites/mainMenuFrame.png', {
  slice9: {
    left: 64,
    right: 64,
    top: 64,
    bottom: 64,
  },
});

 const dialog = k.add([
    k.pos(k.width() / 2 - 200, 300),
    k.sprite('mainMenu'),
  ]);

  dialog.width = 400;
  dialog.height = 300;

await k.wait(0); before adding fixing that as well.

Version

3001.0.9

To Reproduce

  1. Load sprite using slice9
  2. Add it to the first scene
  3. Try to resize using width or height

Expected behavior

Sprites must change size

@juneaucross juneaucross added the bug Something isn't working label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant