Questions tagged [pyglet]

A cross-platform windowing and multimedia library for Python using OpenGL.

Filter by
Sorted by
Tagged with
11
votes
2answers
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 ...
7
votes
2answers
5k 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-...
6
votes
2answers
10k 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 ...
5
votes
1answer
898 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 ...
4
votes
3answers
632 views

What resources are available to read and share pyglet code?

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 ...
4
votes
1answer
3k 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: ...
3
votes
1answer
387 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: ...
3
votes
1answer
2k 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 ...
3
votes
1answer
1k 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
2answers
835 views

Pyglet: 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 ...
2
votes
1answer
2k 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 ...
2
votes
1answer
2k 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
1answer
340 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 ...
1
vote
3answers
6k 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 ...
1
vote
1answer
319 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 ...
1
vote
1answer
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 ...
1
vote
2answers
398 views

What is the difference between resource.texture() and resource.image()?

image = pyglet.resource.image('spritesheet.png') image.blit(0,0) And ...
0
votes
1answer
661 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 ...
0
votes
1answer
93 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
1answer
54 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 ...
0
votes
1answer
4k 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, ...
0
votes
1answer
128 views

How image.ImageGrid() works? How to fix it?

I understood what this method do (it cuts one spritesheet into a list of images), but I don't understood how it cuts. What height and weight for an image, it takes? I tried with few spritesheets png, ...
0
votes
1answer
636 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 ...
0
votes
0answers
25 views

Isometric tile selection formula is slightly off

I almost made the isometric tile selection formula work but it seems to be slightly off. It seems to be working correctly when the mouse is hovered over the first half of the tile but it jumps to ...
0
votes
1answer
34 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
0answers
49 views

Rotating a sprite with Pyglet without changing its X and Y

I have code which rotates a sprite: ...
0
votes
0answers
204 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
1answer
202 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 ...
0
votes
0answers
401 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 , ...