Questions tagged [pyglet]
A cross-platform windowing and multimedia library for Python using OpenGL.
33
questions
0
votes
0
answers
22
views
Casting out vision rays for 2D car in pyglet to return distance from objects?
I am working on a machine learning project that involves training a 2D car to drive around a top-down racing track. I'll be training neural networks using different algorithms and one essential form ...
0
votes
0
answers
59
views
Pyglet TextEntry not Working
I have been trying to make a simple game, and have recently been trying to work on a menu system for it. I am trying to insert a TextEntry box using the examples they have provided themselves.
I have ...
0
votes
1
answer
68
views
Pyglet.gl has no attribute glTranslatef
I have just started working with pyglet trying to make a simple game as a hobby. However, I have run into an issue. I am working with this demo:
https://github.com/pyglet/pyglet/blob/pyglet-1.5-...
9
votes
3
answers
2k
views
Maintaining unit formation while following path
I'm currently working on a 2D Age of Empires style RTS game.
Here's my problem:
I'm currently using the A* algorithm (via Path finding package) to move my units.
When you select a "group" of ...
1
vote
0
answers
112
views
How do I make a 'surface' using pyglet, like in gamemaker studio?
For a project I've been working on, I need to know how to draw to a surface/texture/whatever, that could be used as a texture for binding to a vertex list.
I'm fairly new to python/pyglet, and couldn'...
0
votes
0
answers
189
views
python open .obj file that doesn't have normal information stored
I want to open an .obj file using retcave. Here is the code I am using:
...
0
votes
1
answer
184
views
How do I permanently set the interpolation for every image, sprite, and texture in pyglet to GL_NEAREST in pyglet?
There are plenty of examples of posts that describe how to set the default interpolation of specific images to GL_NEAREST, for example here, but they all have to be run after the image texture is ...
0
votes
0
answers
575
views
Rotating a sprite with Pyglet without changing its X and Y
I have code which rotates a sprite:
...
0
votes
0
answers
500
views
Why are pyglet.image and texture so heavy?
Envrionment:
python: 3.6.6
pyglet: 1.3.2
Here is my code and results:
...
0
votes
1
answer
424
views
pyglet how to disable image smoothing?
I'm using sprites made up of very few pixels. When scaling the sprite gets blurry, so how do I disable this smoothing? I couldn't find anything in the docs or elsewhere online
Sprite:
In pyglet, ...
0
votes
1
answer
84
views
Adjusting arms of character while moving
I'm working on a test game in Cocos2d for Python (code is a little dirty). I'm trying to run and shoot at the same time without having my character's (running) legs go back to the beginning position ...
1
vote
2
answers
480
views
Pyglet Layout won't render?
Here's some sample code I copy pasted to try and get a Pyglet layout to work. I just get a blank screen. Every time I try to write my own code based on the docs or copy/paste some example code it ...
1
vote
1
answer
7k
views
What is the difference between Pygames, Pyglet and Kivy and how each helps python game development? [closed]
I trying to figure out which options would be best to give a graphics to a UNIX based 2D game whose logical part was written in python. Which engine to use.
What is the difference between Pygames, ...
1
vote
2
answers
526
views
What is the difference between resource.texture() and resource.image()?
image = pyglet.resource.image('spritesheet.png')
image.blit(0,0)
And
...
0
votes
1
answer
1k
views
Why doesn't pyglet window respond?
I use the following code in the python command line interpreter, but the window doesn't respond.
import pyglet
window = pyglet.window.Window()
A white window ...
2
votes
1
answer
3k
views
How can I change the anchor point of a Pyglet sprite?
while trying to make my game, I noticed that you can't change the anchor point of sprites in pyglet.
I use some convoluted way (see bottom of the post) to draw my minimap (WIP) so that the rooms are ...
3
votes
1
answer
3k
views
How do I efficiently render the tiles of a tile map?
I've been working on a game, and I've been using Python with Pyglet to create it. I had an issue on how I could do effective tile based rendering. I tried cocos2d, however the API is very efficient ...
1
vote
1
answer
487
views
Pyglet: How to use second screen's vsync
does anybody know if it's possible to use the vsync of the second monitor instead of the first one with pyglet?
I have 2 monitors, one running at 60Hz and the other at 120Hz. I want to be able to ...
3
votes
2
answers
1k
views
How to draw text.Label().draw to FBO?
I just started OpenGL (PyopenGl) & Pyglet 3 weeks ago, and decided to read the Red Book. So sorry if my question shows my lack of comprehension...
My question is: Is it possible to display/write ...
4
votes
1
answer
2k
views
How to draw image in memory manually in pyglet?
In pyglet, I want to create an image buffer in memory, then set the bytes manually, then draw it. I tried making a 3x3 red square like this in my draw() function:
...
3
votes
1
answer
634
views
How to make a map surface object
I'm making a 2d tile based game. In pygame I could create a map like this:
...
5
votes
1
answer
2k
views
How to flip coordinate system in Pyglet?
Is there any way I can flip the coordinate system in Pyglet vertically so that y = 0 is at the top of the screen and a higher y value is closer to the bottom? It is really confusing trying to use ...
1
vote
1
answer
2k
views
example of texture mapping in pyglet
Using pyglet, I am trying to create a UVSphere mesh, and on its surface I would like to display a mercator-projection map. In researching examples of pyglet texture mapping, I have found:
Nehe ...
0
votes
0
answers
476
views
2D Textures are shown through objects in front of it(OpenGL)
I am learning to use pyglet and learning about applying 2D textures to planes in pyglet. When I apply the 2D texture to the plane it works fine. When I make multiple objects with the same texture , ...
0
votes
1
answer
804
views
Why is my obj file imported into pyglet showing a blank screen?
I am trying to figure out how to import .obj files generated using Blender into my Pyglet game. There is an importer object, example code, and an example .obj/.mtl file within Pyglet's contrib ...
4
votes
1
answer
4k
views
How do I implement camera axis aligned billboards?
I am trying to make an axis-aligned billboard with Pyglet. I have looked at several tutorials, but they only show me how to get the up, right, and look vectors. So far this is what I have:
...
5
votes
2
answers
13k
views
2D animation example in pyglet (python) looping through 2 images/sprites every x seconds
Suppose you have two images: step1.png and step2.png .
Can anyone show me a very simple example in pyglet how to loop through ...
1
vote
1
answer
3k
views
Scaling window contents in Pyglet?
I'm trying to scale a window's contents so that every pixel displays at a multiple of it's normal size.
Basically I want to achieve larger pixels without scaling each and every individual sprite.
This ...
2
votes
1
answer
448
views
How to debug pyglet/opengl bus errors
I'm using pyglet for game development, and sometimes encounter "bus errors". They are not consistently repeatable, and whenever I try to do simple debugging (eg move/remove variables, etc), the errors ...
7
votes
2
answers
8k
views
How can I resize pixel art in Pyglet without making it blurry?
I have a tileset of 8x8 pixel images, and I want to resize them in my game so they'd be double that (16x16 pixels, e.g. turning each pixel into a 2x2 block.) What I'm trying to achieve is a Minecraft-...
10
votes
2
answers
5k
views
How can I distribute a native executable for a Python program?
Lately all of my work has been in Python (and Ruby), and I'm in love with those two languages. There are many libraries for game development on Python but the problem I see is that many of those ...
1
vote
3
answers
7k
views
Will I have an easier time learning OpenGL in Pygame or Pyglet? (NeHe tutorials downloaded) [closed]
I'm looking between PyGame and Pyglet, Pyglet seems to be somewhat newer and more Pythony, but it's last release according to Wikipedia is January '10. PyGame seems to have more documentation, more ...
4
votes
3
answers
684
views
What resources are available to read and share pyglet code? [closed]
I am a Python programmer (I know the ins and outs decently well), and I have dabbled with Pygame. I want to make 3D applications and games, and so naturally I've been looking at OpenGL.
pyglet uses ...