I'm testing Pygame 2 (under Ubuntu), and noticed a big change: the Pygame
window now needs to have focus to catch joystick events. This wasn't the
case in the previous Pygame version I was using (1.9.3).
For example if I run this script with Pygame 1.9.3, it catches all joystick
events no matter
I'm working on a project that uses two different joysticks simultaneously.
I can read them individually, but only one at a time.
I was wondering if there might be some code out there to show how to read
them simultaneously? In other words to fire commands whenever one of the
joystick states
I have a strange problem: when my Pygame app is running it prevents my
monitor from ever turning off. No other program that I can find does this
on this computer. Running Ubuntu.
If I disable the Pygame GUI in the script the monitor powers off after 15
minutes as usual.
Is this expected
I posted it here fyi:
https://bitbucket.org/wrybread/nye-countdown/src/master/
On Sat, Dec 29, 2018 at 9:57 AM Alec Bennett wrote:
> I made a little Pygame script that shows where it's New Year's Eve for
> every hour on Monday, designed to be shown on a projector so people can
> have
I made a little Pygame script that shows where it's New Year's Eve for
every hour on Monday, designed to be shown on a projector so people can
have a little party every hour, not just at midnight locally. Plays a
little countdown video (using VLC bindings) for maximum effect at the
stroke of
I'd like to embed VLC, MPV or Mplayer in a Pygame surface if it's possible.
I found this old link:
https://gist.github.com/smathot/1521059/1680f906d508368a46b80e8ba01aa627c2e781fa
I'm getting errors when attempting to run it. Before troubleshooting
farther I thought I'd see if there's an updated
and re render your background UI.
>>
>> You may also want to consider what events you should delegate to the menu
>> and which you should capture for yourself. Eg. You may want to prefilter
>> the events and handle the pygame.quit event yourself.
>>
>> On Mon, S
Sorry for the cross post, I posted an issue to the project's github page
here:
https://github.com/ppizarror/pygame-menu/issues/19
For anyone interested, note the fix I posted there. Feedback invited.
On Sun, Sep 23, 2018 at 10:08 PM Alec Bennett wrote:
>
>
> On Sun, Sep 23, 2018 at
t.
> On Sun, Sep 23, 2018 at 11:10 PM Alec Bennett wrote:
>
>> I'm trying to add the beautiful menus from Pygame-menu (
>> https://github.com/ppizarror/pygame-menu) to my project, but having
>> trouble. In my attached stripped down sample, I'm trying to show menu
Apologies, there were a few errors in my sample. Attached is a fixed
version.
If anyone has any tips about how to close the menu, I'd love to hear. I can
close it with the ESC key, but not by selecting an item.
import pygame, sys
from pygame.locals import *
import pygameMenu#
I'm trying to add the beautiful menus from Pygame-menu (
https://github.com/ppizarror/pygame-menu) to my project, but having
trouble. In my attached stripped down sample, I'm trying to show menu1 when
the 1 key is pressed, and show menu2 when the 2 key is pressed. They're
both "main menus"
I'm making a controller for a PTZ ("pan/tilt/zoom") camera using Pygame, so
I can move the camera around with a gaming joystick. It works but the
motion is very jerky.
The camera expects a "start" action ("start moving the camera left") and
then a stop action ("stop moving it"). I'm handling that
n
under Linux that would do it reliably? I suppose I could slave two
instances of mplayer, but I'd of course prefer to not be forking out
processes.
If anyone's curious about the files I'm trying to load, I posted some test
files here:
sinkingsensation.com/dropbox/icecream.zip
On Thu, Jun 7, 2018
On Thu, Jun 7, 2018 at 7:59 AM, Christopher Night
wrote:
> I recommend saving the sound as a raw buffer. First in a separate script:
>
> sound = pygame.mixer.Sound("music1.wav")
> open("music1.buf", "wb").write(sound.get_raw())
>
> Then in your game:
> sound =
>
>
>
> A second solution is to load the sounds in the background of the game,
> especially if you're going to launch on a menu where the sounds won't be
> needed. You can pre-populate a dictionary with dummy sounds and use a
> thread to go through and load each sound into the dictionary while the
On Thu, Jun 7, 2018 at 4:21 AM, Greg Ewing
wrote:
> Alec Bennett wrote:
>
>> 16 bit wav files. 1411 kbps. About 5 megs each but one is very long (a 13
>> minute medley of all of them, 133 megs).
>>
>
> Okay, I didn't realise they were that big -- I wa
:
> Alec Bennett wrote:
>
>> since it needs to load each of the 20 sounds on startup it takes about 30
>> seconds to load. I'm running it on a Raspberry Pi, which doesn't help of
>> course.
>>
>
> How big are the sound files? Unless they're really enormous,
> t
ght do this with a class:
> https://gist.github.com/pydsigner/231c0812f9f91050dd83c744d6d5dc4b
>
> On Thu, Jun 7, 2018 at 12:31 AM, Alec Bennett wrote:
>
>> Sorry, I left out the line where I try to save the file:
>>
>> > pickle.dump( sound_obj, open( "sound
Sorry, I left out the line where I try to save the file:
> pickle.dump( sound_obj, open( "sound.pickled", "wb" ) )
On Wed, Jun 6, 2018 at 10:29 PM, Alec Bennett wrote:
> I'm building a musical horn for my car with PyGame, and it works
> perfectly, but since it
I'm building a musical horn for my car with PyGame, and it works perfectly,
but since it needs to load each of the 20 sounds on startup it takes about
30 seconds to load. I'm running it on a Raspberry Pi, which doesn't help of
course.
I thought I'd simply save the Sound objects as pickle objects,
Another possibility would be to execute a command that moves the mouse way
off screen?
https://unix.stackexchange.com/questions/164262/can-i-simulate-mouse-movements-via-terminal-without-xdotool
On Fri, Jul 14, 2017 at 5:26 AM, Annette Wilson
wrote:
> Hi, I'm not
Why not just programmatically move the mouse offscreen?
Or change the mouse cursor to something invisible. Both are easy under wx
python, im guessing easy with pygame too.
> On Jul 5, 2017, at 4:22 PM, Greg Ewing wrote:
>
> Роман Мещеряков wrote:
>> I
Or if someone wants to be curator, just replace the whole submission
process with an email address and/or Dropbox link, and let people submit
the projects that way?
On Thu, Apr 28, 2016 at 10:28 AM, DiliupG wrote:
> I was not trying to be rude or offensive to anyone. If it
I've found what works very well to fight spam is a small bit of domain
specific knowledge. Questions like What pygame function should be called to
create a window? should be relatively easy for someone who uses pygame to
answer, but would likely work surprisingly well to keep spammers at
You can easily get the mouse position regardless of focus under Windows
using the win32api:
mouse_pos = win32api.GetCursorPos()
On Thu, Jan 15, 2015 at 3:26 PM, Weeble clockworksa...@gmail.com wrote:
It is possible, just not entirely obvious. I believe you need to:
1. Grab mouse focus
Super cool Ted. The video was indeed worth it...
And thanks for pointing out that distro with the video module enabled.
On Wed, Dec 17, 2014 at 4:26 PM, Ted Hunt ted.h...@clear.net.nz wrote:
Thanks Luke for pointing this out.
I've changed the code skip the movies if either the movie
On Thu, Dec 4, 2014 at 3:00 PM, Harry Keys pbrgamers...@gmail.com wrote:
I wouldn't mind seeing pygame 2 be able to directly capture keystokes /
mouse clicks while running in the background as well.
Seconded. That's pretty much the number one thing I miss when working with
Pygame on OS's
I think the VLC Python module can also route to multiple cards, fyi. And it
has the advantage over PyAudio of being able to play lots of different
formats.
On Thu, Nov 6, 2014 at 1:54 PM, jasonmarshall...@gmail.com wrote:
Scott,
I think that PyAudio is what you're looking for.
And if you put that line after the pygame.init() line?
On Wed, Oct 29, 2014 at 7:37 AM, NuMedia ianldickinso...@gmail.com wrote:
Hi can any one help with this when using python 2.7 and above or 3.X the
line
if not pygame.mixer:
print 'Warning, sound disabled'
message gets printed
Capturing keystrokes in the background is something I've had a lot of
problems with too. On Windows, the PyHook module works great for this, as
does the win32api module. Something like:
# keyboard c
i = win32api.GetAsyncKeyState(67)
if i 0:
For win32api, you need to install the Python Windows Extensions.
For Pyhook, there's lots of examples out there, but maybe someone wants to
work on your code for you.
On Mon, Oct 27, 2014 at 11:33 PM, PBRGamer pbrgamers...@gmail.com wrote:
Oh, and I tried the easy way with the win32api but
()
On Mon, Oct 27, 2014 at 11:39 PM, Alec Bennett wrybr...@gmail.com wrote:
For win32api, you need to install the Python Windows Extensions.
For Pyhook, there's lots of examples out there, but maybe someone wants to
work on your code for you.
On Mon, Oct 27, 2014 at 11:33 PM, PBRGamer
analogy is probably wrong.
On Mon, Aug 25, 2014 at 10:49 PM, diliup gabadamudalige dili...@gmail.com
wrote:
https://en.wikipedia.org/wiki/Malware
doesn't fall into the category. :)
On Tue, Aug 26, 2014 at 11:10 AM, Alec Bennett wrybr...@gmail.com wrote:
some games lock up the os
If you're clearing the Windows clipboard, you might want to let the user know
that. Very prominently. Otherwise your program is basically malware in my
opinion.
It's still, in my opinion, malware, but at least you'd be warning the user so
they'd know that running your program will cripple
and you need to exit the game to have access to
the os. Does that make the game a malware?
On Tue, Aug 26, 2014 at 10:46 AM, Alec Bennett wrybr...@gmail.com wrote:
If you're clearing the Windows clipboard, you might want to let the user
know that. Very prominently. Otherwise your program
Please post what you wind up using, this comes up for me pretty often too.
In Windows there's a super easy way to get global keypresses, but I haven't
found anything in *nix.
Windows method:
i = win32api.GetAsyncKeyState([keycode])
On Thu, May 30, 2013 at 1:02 AM, winkleink
Are you sure you installed pygame on that computer? That's not an import error,
it's simply not finding the module at all.
Maybe you installed to some other python installation on that computer?
--
Sent from my gizmo.
On Feb 14, 2013, at 7:08 PM, Mt.Rose$TheFerns arcktri...@aim.com
Sweet.
Agreed.
And I'll see you there.
--
Sent from my gizmo.
On Jan 20, 2013, at 11:13 PM, René Dudfield ren...@gmail.com wrote:
Sweet!
On Jan 21, 2013 7:02 AM, Richard Jones r1chardj0...@gmail.com wrote:
Hi all,
Just wanted to let you know that I'm giving an introduction
On Mon, Oct 29, 2012 at 3:29 PM, Noel Garwick noel.garw...@gmail.comwrote:
As far as I know, video support is still missing for Pygame subset for
Android.
Can anyone think of a way to work around this issue? Maybe a way to play
video as an external process?
Or would it be hard to add video
I need to do an Android project that simply plays one of five videos, and I
was considering using Pygame for it.
I was wondering if this would be possible? Can I play fullscreen video
using Pygame on Android?
I'd be using the Google Nexus 7, if that's a factor.
The video can be in whatever
There's a lot wrong with that sample you posted.
You probably also want:
DISPLAYSURF.blit(scoresList[0],scoresList[1])
Instad of:
DISPLAYSURF.blit(scoresList[0][0],scoresList[0][1])
But I didn't get very far, because each time I'd fix one bug there was
another.
There's also a typo, search
.
On Wed, Oct 24, 2012 at 8:25 PM, Alec Bennett wrybr...@gmail.com wrote:
There's a lot wrong with that sample you posted.
You probably also want:
DISPLAYSURF.blit(scoresList[0],scoresList[1])
Instad of:
DISPLAYSURF.blit(scoresList[0][0],scoresList[0][1])
But I didn't get very far
This project provides a simple to use GUI toolkit that can be easily
dropped into an existing game project. It will run with no code
Very interesting.
Are there screenshots available?
And out of curiosity, does the look of the widgets vary on different OS's?
You might consider an intro to Python tutorial or two before attempting to
write a game...
On Mon, Oct 8, 2012 at 10:47 AM, shane shanevansh...@yahoo.com wrote:
Hi
Ive loaded the following on to my computer what else do i need to look for
and load to write games but then to test and play
--- prebuilt-msvcr90.
--- prebuilt-pygame1.9.0-msvcr71-win32.zip
--- prebuilt-pygame1.9.0-msvcr90-win32.zip
*From: Alec Bennett wrybr...@gmail.com
You might consider an intro to Python tutorial or two before attempting to
write a game...
--
View this message in context
The solution was right there as a comment in your code: you need to add
return True if you want to pass the keypress along. Conversely, return
False will block it.
Something like:
def OnKeyboardEvent(event):
print event.ScanCode, event.Key
return True
On Mon, Mar 19, 2012 at 6:32
Someone really needs to turn this thread into a game...
On Tue, Mar 13, 2012 at 5:34 PM, Brian Brown bro...@gmail.com wrote:
I started QBasic at about 12. . .
I am nearly completely self-taught and
I started making my ball program in Java at about 14-- I carefully thought
out the
If you're using JAWS, I'm guessing you're running Windows?
If so, you might look into the PyHook module. I don't know if it hooks
keystrokes before or after JAWS, but its worth a try.
Then there's also the win32api. Something like:
win32api.GetAsyncKeyState(100)
Again, no idea how it'll work
For PC installers, you might give the Nullsoft Installer (aka NSIS) a try:
http://nsis.sourceforge.net/Main_Page
Works great. Easy to use once you get the hang of it.
On Tue, Feb 21, 2012 at 1:53 PM, Keith Nemitz muse...@yahoo.com wrote:
On Mac, I use py2app. On Windows I use py2exe and
And out of curiosity, what huge advantage would Python 3.0 give you, over,
say, 2.7?
On Sun, Feb 12, 2012 at 11:04 PM, Santiago Romero srom...@sromero.orgwrote:
On Mon, Feb 13, 2012 at 2:21 AM, Zack Baker zbaker1...@gmail.com wrote:
I've only been on the mailing list for a few months now
I think it would depend on what sort of look and feel you're going for.
Pygame would probably be great for making something simple and highly
graphical, like a bunch of graphical buttons.
But if you want something more complicated than that (menubars, toolbars,
child windows, even groups of
Have you tried the pyHooks module? It can hook the keyboard at what might
be a lower level than pygame. I know, for example, that it works whether or
not the application has focus.
There's a demo script that prints all the info about a given keystroke,
maybe there's something in it that
Out of curiosity, what would be an example of an experiment you conduct that
involves PyGame?
On Nov 8, 2011, at 1:13 PM, Ryan Hope rmh3...@gmail.com wrote:
PyGame has increased my productivity as a research by an order of
magnitude. Experiment that used to take me weeks to code up in
games for blind people
This is such an interesting discussion.
What about a game of concentration, where each keyboard key has a different
sound, and you have to find the other key with the same sound? Any key
that's already been paired will then be silent or give some white noise
sound.
The
I'm a big fan of using the game Simon as a vehicle to learn a programming
language.
I'm using an image with transparency as a Sprite. The image has an irregular
shape:
http://sinkingsensation.com/stuff/shape.png
I'd like to detect collisions with it.
My current strategy is to draw a polygon (pygame.draw.polygon) behind the
image. That works, but its difficult to make the
56 matches
Mail list logo