Comments (2)
I believe we might have like a boolean in the RenderContext providing a smoothing,
and then make the one from the view also nullable Boolean.
Then at each view we can do something like view.smoothing ?: context.smoothing
to determine how to render it.
In any case, if you are making a pixel art game, have you considered having a PixelatedScene with a lower resolution, so it is pixel perfect, and then let the engine scale it? If you are doing pixel perfect, smoothing might work for you?
BTW: That circle looks like blurred when smoothed, but that's a separate issue, probably related to SDFs and retina. Probably this #2116
from korge.
RE: PixelatedScene
I didn't know this was a thing! I just tried it, and here's what it looks like to render on a virtualSize 1/4 the windowSize:
suspend fun main() = Korge(
virtualSize = Size(128, 128),
windowSize = Size(512, 512),
backgroundColor = Colors["#ffffff"]
) {
val sceneContainer = sceneContainer()
sceneContainer.changeTo({ MyScene() })
}
class MyScene : PixelatedScene(
sceneWidth = 128,
sceneHeight = 128,
) {
override suspend fun SContainer.sceneMain() {
circle(30, fill = Colors.BLUE)
}
}
As you can see, there still is anti-aliasing applied near the curves of the circle. Some devs may like this look, but if one wants to turn it off, they'll have to do set the antialiased = false
on each view, much like with smothing
. Ideally, this is also a a configurable setting on PixelScene.
circle(30, fill = Colors.BLUE){
antialiased = false
}
Regardless, I think this feature request still stands, as some developers may prefer the visual style where all sprites are pixel graphics, but positions can be floats, and pixels can be rotated (e.g. Terraria or Vampire Survivors)
from korge.
Related Issues (20)
- Change graphics settings at runtime is not working: fps & antialiasing. HOT 1
- readSound.play have issues in JVM windows while readMusic seems to work fine
- KorAU - PlaybackParameters - startTime is not working
- Unexpected results with CharReaderFromSyncStream when chunk size is less than reading count
- Why korlibs-crypto depends on korlibs-time? HOT 1
- LinuxArm64 and other native targets for time and crypto? HOT 4
- Circles and RoundRects not rendering properly (blurry and bad strokes) HOT 1
- Implement `View.positionWithAnchor` when intersection types are available
- Provide a `View.simpleAnimatorSequence`
- Support for watchOS HOT 1
- Fixed Point Integer classes lack some math functions and still use float / doubles in some of their underlying operations.
- Request: Support TCP Low Latency mode for TCP sockets. Also support QUICK ACK for TCP sockets. HOT 3
- Request: Add Support for UDP Connections in KorGE "common" code. HOT 5
- Issue with importing firebase gitlive 1.11.1 HOT 1
- Allow to specify android properties after `targetAndroid`
- korlibs.graphics.gl.AGOpengl$ShaderException: Error Compiling Shader HOT 2
- Support npm transitive dependencies with esbuild
- [Nit Bug] Mac touchpad zoom in finger gesture on a JVM app window creates error log noise. HOT 2
- Allow setting stroke width on line() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from korge.