Tagged Questions
1
vote
0answers
10 views
Pyglet: sprite not drawing if used in a batch
I have this function for a game, message_box, which shows a nice background(a Sprite) and in the top of it, a label(it's text is the string parameter received).
When I call the method draw() of it, ...
0
votes
1answer
37 views
How to subclass Clock in Pyglet?
I want to subclass Clock class of pyglet.clock module, but I have some troubles when I use schedule_interval:
The following code doesn't print anything and the object c looks like if not ticked at ...
1
vote
1answer
41 views
3d cube didn't show correctly writen by pyglet
Recently, I have started to learn openGL from this site => http://3dgep.com/?p=2365
and I encounter a problem. That's I didn't get the scene as the site shows.
I post my code on this site:
import ...
2
votes
0answers
61 views
Pyglet, shaders and GLSL layout tag for color attribute
I'm trying to use pyglet and OpenGL 4 style shaders (ie: not using any matrix operations, using (layout=...) etc...)
I have a basic vertex shader which is:
#version 400
uniform mat4 ...
0
votes
1answer
75 views
Pyglet sound playing on python
I am trying to play some sounds with Python, but I am encountering problems.
This is my code (very simple, only for learning):
def parse(fd):
for line in fd:
for word in line.split():
...
2
votes
1answer
72 views
How to create OpenGL 3.0 context using Pyglet
I'd like to make use of OpenGL 3.0 features (framebuffer objects, 2D texture array), but the default OpenGL context created by Pyglet does not support these.
In the Pyglet source there is the ...
0
votes
2answers
85 views
Import pyglet on python
I have downloaded the pyglet.dmg file from pyglet website and simply installed it.
The folder on which it is saved is: /Developer/pyglet
And on the pydev editor i simply state the location i want to ...
1
vote
0answers
34 views
Unable to open a window with Pyglet
I decided to look into Pyglet to experiment with graphics and hit the ground face first with some errors. Right off the bat, I had issue simply trying to create a window. I would get multiple errors ...
1
vote
0answers
40 views
How to add another object's handlers to a window with Pyglet
I have a main object with a Pyglet window as an attribute. Pylget's window class has a method called push handlers, which lets me push methods to the event stack. The following code works:
import ...
1
vote
2answers
108 views
using numpy arrays and ctypes for OpenGL calls in Pyglet
I've got what seems like a very ugly little piece of code that I seem to keep on resorting back to whenever I'm trying to draw arrays with pyglet, of the form:
vertPoints = ...
0
votes
1answer
92 views
How to draw two circles facing each other in 3D space
I'm attempting to draw a network in 3D using Python's Pyglet library.
I have spheres representing proteins and they are drawn in place (given x,y,z coordinates) rather than drawing them at 0,0,0 and ...
0
votes
1answer
57 views
How to use super in Pyglet in Window's subclass events?
I want to subclass pyglet.window.Window, but this code throw me exceptions for super in on_draw() and in on_mouse_pressed()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pyglet
class ...
0
votes
0answers
21 views
Intercepting and modifying events in pyglet
Is there any way to intercept and modify events in pyglet.
In this case I am interested in intercepting mouse events, doing some scaling from screen coordinates to model coordinates, and then letting ...
1
vote
0answers
87 views
Pyglet, player, next song
I'm trying to play songs in Python 3 via pyglet. I can play and stop a song, but when I try to play the next song it produces an error. I followed these instructions. I will do the program in tkinter.
...
1
vote
1answer
68 views
Incorrect colors when reconstructing an image from arrays with pygame/pyglet
I wrote up this program that would use numpy and Image(PIL) library to read an image as a bunch of matrices and use pyglet(and opengl) to reconstruct the image.
The code using pyglet is as follows:
...