Giter Site home page Giter Site logo

Comments (1)

joshtynjala avatar joshtynjala commented on May 25, 2024

Copying my response from the Discord. Maybe it'll be useful to someone else too, if this thread shows up in a Google search.

From your project.xml file:

<window width="1024" height="768"/>

When you set the <window> width and height to something lower than the browser window dimensions for the html5 target, a lower rendering quality is expected with our default index.html template because that template still makes the canvas fill the entire browser view port. In other words, it is scaled up from a lower resolution. It should be a little blurry.

When you bump up scaling outside of OpenFL, the browser's window.devicePixelRatio is increased. That's the value OpenFL uses to determine how much it should scale itself for HiDPI screens. So OpenFL is rendering at higher quality than it normally would for the window dimensions that you specified (but closer to what it would be if you had specified no window dimensions at all). Since the canvas still fills the same amount of space in the browser window, it ends up looking crisper.

Both behaviors are expected when you specify window dimensions in project.xml for the html5 target.

from openfl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.