If you use a float to fill, you get a grey border around your filled square
As an example, add this to your player script:
on draw do
fl = 15
fl /= 2
fill "white" at 0,0,fl,fl
end
You'll see on the top left a white square with a grey border. Is this just a simulator issue? Would actual hardware show something else?
dwineman
(Dan Wineman)
January 21, 2022, 7:04pm
2
Yup, simulator or browser issue. The hardware has only black and white pixels. Thanks for the report!
dwineman
(Dan Wineman)
January 21, 2022, 8:48pm
3
Here’s how it looks on the device. As you can see, the half-pixels are rendered fully white.
1 Like
Cool, thanks for testing that. So I can use ceil
to make the browser match the hardware.
shaun
(Shaun Inman)
January 21, 2022, 9:10pm
5
Yup, these values should be clamped by the runtime when used as arguments to functions that expect an integer. But if you want to ensure it’s rounding in a specific direction, manually using floor
or ceil
is definitely the way to go.