Comments (2)
Good point. I see there's a TODO in DisplayOpenGL on that subject. It's probably rather difficult to do in your code as it needs an additional event mask setting up in DisplayOpenGL and the event checking in Display needs to catch resizes. i.e. DisplayOpenGL
xlib.XSelectInput(self.d, self.window, KeyPressMask | KeyReleaseMask | ResizeRedirectMask)
and Display
n = xlib.XEventsQueued(self.opengl.d, xlib.QueuedAfterFlush)
for _ in range(n):
xlib.XNextEvent(self.opengl.d, self.ev)
if self.ev.type == KeyPress or self.ev.type == KeyRelease:
self.event_list.append(self.ev)
elif self.ev.type == ClientMessage:
if (self.ev.xclient.data.l[0] == self.opengl.WM_DELETE_WINDOW.value):
self.destroy()
elif self.ev.type == ResizeRequest:
(self.width, self.height) = (self.ev.xresizerequest.width,
self.ev.xresizerequest.height)
opengles.glViewport(0, 0, self.width, self.height)
self.was_resized = True
then in programs
if DISPLAY.was_resized:
# move shapes and fix camera
However the the normal Camera.reset() with different lens settings doesn't work properly and creating new Cameras and setting Shape._camera = new_cam
also has issues. I will let you know when I've figured out what to do, and will post the revisions to pi3d develop branch. Hopefully something quick to do.
Paddy
PS to answer the first part of your question. You can get the Display size using its width
and height
properties. So if your button is bw
xbh
it will be in the bottom right corner:
...
button.positionX((display.width - bw) * 0.5)
button.positionY((diplay.height - bh) * 0.5)
from pi3d.
Many thanks, that'll keep me going
from pi3d.
Related Issues (20)
- Not working on Raspberry Pi 4 (Raspbian) HOT 11
- OffscreenTexture with alpha channel HOT 3
- Display.create ignores tk on linux HOT 8
- problems running on fedora28 HOT 8
- "X11 needs to be running" on Ubuntu Desktop 19.10 (intel cpu/gpu) HOT 4
- Name only shows for 1 second, and disappears. HOT 2
- Memory not freed when free_after_load is True HOT 5
- How to add touchscreen support HOT 2
- 'assert r' error due to old API usage and advice on latest API usage HOT 16
- pi3d on Ubuntu 20.04 HOT 11
- DISPLAY_CONFIG_NO_RESIZE makes the window resizable
- pi3d.Slice() unexpected angle HOT 4
- Blue Screen (Not BSOD) on relaunch of pi3d HOT 9
- gltf support? HOT 2
- problem running examples in CLI mode (no context) HOT 2
- Run PictureFrame.py without indexing? HOT 1
- Win 10 not every example is working HOT 6
- AttributeError: 'NoneType' object has no attribute 'glActiveTexture' HOT 6
- AttributeError: 'DisplayOpenGL' object has no attribute 'context' 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 pi3d.