Comments (3)
I also see this problem on Mac OS. I have an M1 Mac Mini with macOS Ventura. 13.1. 32-inch (3840 × 2160)
Version 0.3.1 of game zero.jl
I have to add the *2 to the mouse position to make the cursor properly track. The window is drawn twice as big as it should be. The lines are only in the 1st quadrant and do not fill the window.
Also I cannot close the window by x-ing out of it. It hangs around even though the prompt comes back in Julia.
Example code below that can be put into a file and run with gamezero.
# initialize screen
WIDTH = 600
HEIGHT = 600
BACKGROUND = colorant"antiquewhite"
# define initial state of actors
hline = Line(0, 300, 600, 300)
vline = Line(300, 0, 300, 600)
mouse = Circle(300,300,50)
function draw(g::Game)
draw(hline, colorant"black")
draw(vline, colorant"black")
draw(mouse, colorant"blue", fill=true)
end
#define mouse inputs
function on_mouse_move(g::Game, pos)
mouse.x = pos[1]*2
mouse.y = pos[2]*2
end
from gamezero.jl.
Yes, unfortunately I haven't been able to find a fix for this yet.
I use GameZero/SDL2 on Windows with a HiDPI display, and it works correctly. It even works with fractional scaling (my monitors are set to 175% and 150% scaling).
SO suggests the corrent way to handle this in SDL is to set SDL_WINDOW_ALLOW_HIGHDPI
when creating windows, which we do use here , and that seems to work correctly on windows.
Would appreciate any ideas or investigations.
from gamezero.jl.
So is there a change to the code above that I need to make to resolve it or is it just unusable on MAC.
We just need to pass this issue to the SimpleDirectMediaLayer people? Or is there a different combination of switches that MACOS need?
from gamezero.jl.
Related Issues (20)
- `Circle` does not have same properties as `Actor` e.g. actor.pos, actor.position HOT 2
- Impossible to include other files in the game HOT 5
- Too many open files error HOT 5
- Make GameZero types better and more extensible HOT 2
- does not launch game window HOT 3
- UndefVarError: libsdl2_{ttf,image} not defined (Apple Silicon / M1 Mac) HOT 6
- Is GameZero.jl going to get any more updates? HOT 1
- Draw basic forms (Rect, Triangle) with angle
- How to prevent clearing of the screen? HOT 2
- Gamepad Controller Support HOT 1
- Unicode Chinese Characters (ttf) are not being shown HOT 5
- Unicode Chinese Characters (ttf) are not being shown HOT 2
- Control Render HOT 1
- New Bug HOT 1
- not working on julia 1.9 HOT 1
- This isn't an issue but I though it would be cool to share.
- Will GZ.jl eventually be able to do multiple files in a project? HOT 2
- Attempting to load resource files crashes HOT 1
- Create Actor from pixel data instead of image file HOT 1
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 gamezero.jl.