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
Weird behaviour when LayoutF returns small sizes, e.g. 1.33,1.00 #2988
Comments
Would it be possible to minimize the reproducible case more? Thanks |
You mean the size less than 2...? |
Yes. I wanted to make scalable UI/game, so that at any resolution I am drawing in 0..1 coords. I will try to simplify the code tomorrow. |
This means the screen size is only 1 or 2 pixels. Ebitengine doesn't expose the texels (0-1). |
... well, then I am not understanding the documentation. LayoutF allows for float return size, and the docs say: If there is expectation for Layout() to return size in pixels, then I do not understand LayoutF(). What would the meaning of e.g. return 640.445, 320.128 mean? Fractional pixel sizes? |
There is expectation both for Layout and LayoutF to return size in pixels. Returning 640.445, 320.128 at LayoutF means the internal offscreen framebuffer size is (probably) 641 and 321, and 640.445, 320.128 are also used for the scale of the offscreen framebuffer to the final screen framebuffer. |
Fair enough. I still do not understand your explanation for fractional pixel sizes returned from LayoutF(). But I don't have to understand it. I would just kindly ask to add a comment to Layout() that the return should be in pixels. That would make it obvous that e.g. 1.33 would show only a single pixel. The issue can be closed if you agree. |
Sure, I'll add more comments. Thanks! |
Ebitengine Version
2.7.3
Operating System
Go Version (
go version
)go version go1.22.2 linux/amd64
What steps will reproduce the problem?
Run this code, and provide your own image in the "resources/" directory.
What is the expected result?
What happens instead?
Image stays in place until the window size crosses some boundary; then the image jumps to new place and stays in place until next "boundary".
Anything else you feel useful to add?
I am guessing, but it seems that internally engine is using integers, so using floats for drawing, sizing etc like I do hits some rounding issue internally. I.e. the engine cannot work with pure floats.
The text was updated successfully, but these errors were encountered: