Pixel perfect scale request, aka no smooth
Closed this issue · 4 comments
Nearest neighbor scaling mode for viewport. Simply read the drawing pipeline of Joy, but didn't find much about scaling. Is it possible to forbid smooth when scaling viewport? And more, is it possible to set a scale factor for the whole game now?
Hey @pixelpicosean, you can set each Sprite as smooth: false. Every scene have a viewport attached, and it's possible to scale it.
Here is a live example using smooth:false
for every sprite, and scene.viewport.setup
to resize the viewport.
That's what you need?
@endel Thanks, it works for me. But it's still not that convenient, scale 2x or even 4x is what most retro style games will do.
A very personal question: do you prefer one behavior per entity or one per function and use a fews to define an entity?
I think we should have a better approach for these default values. Defining on the Engine initialization I think is straightforward. Do you like such?
var engine = new Joy.Engine({
width: 320, height: 240,
defaults: {
smooth: false
}
});
Yes, that'll be cool.
I plan to create a editor for joy but it seems lots of work to do, I'll dive into the development after finishing current game project. Thanks for your great work.