amethyst / amethyst/bracket-lib

Sprites artifacts with scaling

Ouverte
#220 8 commentaires 0 réactions 1 personne assignée Réclamée par @thebracket Voir sur GitHub
bug
Langage dominant
Rust
Étoiles
1.7k
Forks
126
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

I'm trying to add sprites to my game, and there is a texture problem: depending on the sprites' size and/or the window scaling, pixels surrounding the sprite are sometimes drawn on screen.

As an example, here is the "eye" sprite, with its surrounding pixels:

![image](https://user-images.githubusercontent.com/3216752/125664218-7dfa2389-1a83-4199-ac01-34ca434e8b73.png)

But the in-game rendering sometimes trim pixels on a side, and sometimes add pixels from neighbour sprites
![image](https://user-images.githubusercontent.com/3216752/125667476-d31bd96d-5e3f-4ba6-920f-d0e28d1b9037.png)

The BTerm is built like that:

```rust
let context = BTermBuilder::new()
.with_title("Roguelike Tutorial")
.with_tile_dimensions(16, 16)
.with_simple_console(80, 50, "16x16-sb-ascii.png")
.with_font("16x16-sb-ascii.png", 16, 16)
.with_sprite_console(16 * 80, 16 * 50, 0)
.with_sprite_sheet(
SpriteSheet::new("resources/MRMOTEXT_rexpaintx2.png")
.add_sprite(Rect::with_size(144, 352, 16, 16))
)
.with_vsync(false)
.build()?;
```

Both PNGs have 16x16px tiles/sprites. I tried different settings to fix this issue but to no avail.

Edit: same issue when the spritesheet is used as a font file:
![image](https://user-images.githubusercontent.com/3216752/125673169-03c10256-317e-4670-9394-ef2be1c5fb67.png)

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.