Gerald Thibault | 18 Apr 10:13 2014
Picon

Sprite draws fine, how do i get the pixel data?

I have this script, which reads from a 32x32 dds file.

import pyglet

image = pyglet.image.load('char_2.dds')
tex = image.get_texture()
tex.width = 48
tex.height = 64

sprite = pyglet.sprite.Sprite(tex)
    
window = pyglet.window.Window()
    
<at> window.event
def on_draw():
    sprite.draw()

pyglet.app.run()


This correctly scales the image to 48x64 and draws it to the window. How do I get the raw pixel data that was drawn to the window? I've been googling this for hours and have been unable to find a solution. I'm not even interested in drawing to the window, or using the sprite class at all, but I was unable to find any examples at all of how to upscale an image with independent scale values for x and y. This is the closest I've been able to get to an expected end result, but I can only get it in the window, I have no idea how to get those pixel values. Did I miss something glaringly obvious in the docs? All I want to do is scale an image and get the pixel data, I don't want to draw anything to the window (or have any window at all).


--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Kevin Wells | 14 Apr 21:34 2014
Picon

Change Quicktime file Audio channel Assignment

Hi, I am very new to pyglet and wondered if I could use it to open a quicktime mov file and change the audio channel assignment flags, Left, Right, Centre, FLE, left Surround, etc, and also check and change the timecode track. I want to do all this and just save the file, not export out a whole new file. This can all be done in quicktime pro, but I wanted to accomplish this with Python.

Kind regards.

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
"Juan J. Martínez" | 9 Apr 20:17 2014
Picon

Pixel fonts

Hello,

I've just released some classes I use to render pixel fonts when I don't
want to use pyglet TTF fonts (that look bad when doing viewport scaling
for old-style pixel graphics).

https://github.com/reidrac/pyglet-pixfont

It basically manages ImageGrids to translate strings into Sprites that
can be drawn using a Batch.

I don't know if there's a better way of doing it, but it might be useful
for someone else ;)

Regards,

Juan

-- 
jjm's home: http://www.usebox.net/jjm/
blackshell: http://blackshell.usebox.net/

--

-- 
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Vincent Damoy | 9 Apr 13:20 2014
Picon

Problems to convert images in DDS format

Hello,

I'm working on Ubuntu 12.04, with Python 2.7 and Pyglet 1.1.4 (the ubuntu repository version)
I'm trying to create a small python script to browse images in a folder and transform it in another format. (I joined it to this mail).
I've modified the image_convert.py example, which I found in the pyglet's examples folder.

The script works well with several image formats (JPG-> PNG, PNG->JPG...), except if I want to transform pictures in DDS.
In this case, pyglet returns an exception :

--------------------------------------------------------------------
Traceback (most recent call last):
  File "image_convert_travail.py", line 40, in <module>
    convert(folder)
  File "image_convert_travail.py", line 25, in convert
    image.save(namefile+'.dds')
  File "/usr/lib/pymodules/python2.7/pyglet/image/__init__.py", line 442, in save
    encoder.encode(self, file, filename)
  File "/usr/lib/pymodules/python2.7/pyglet/image/codecs/pil.py", line 104, in encode
    raise ImageEncodeException(e)
pyglet.image.codecs.ImageEncodeException: 'DDS'
--------------------------------------------------------------------

I understand that pyglet doesn't find the DDS encoder.
Do you know where it is? (I didn't find it in pyglet files)
Does it exist in Linux package? (a friend of mine succeeded to encode a DDS file with the original script, but he works under windows)
Or may be "image.save(namefile+'.dds')" is not sufficient... Should I compress the texture before saving it in dds format?

Thanks for any reply.
All the best.
Vincent

 

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Attachment (image_convert_send.py): text/x-python, 818 bytes
jwclark2 | 2 Apr 21:12 2014
Picon

Re: image blit works but sprite draw broken?

I figured out that the problem is an incompatibility between the pyglet sprite module and AMD video cards.
This problem came up on Stack Overflow about a year ago: http://stackoverflow.com/questions/9693934/cant-draw-sprites-in-pyglet.
The workaround in reply # 3 here (http://code.google.com/p/pyglet/issues/detail?id=544#c3) worked for me.  Just change "v2i" to "v2f" in two lines of sprite.py.
Hopefully I haven't broken my game for other people!


On Tuesday, April 1, 2014 5:29:51 PM UTC-7, jwcl... <at> asu.edu wrote:
I was working on an unfinished game which worked fine on my old computer, with python 3.3 and pyglet 1.2alpha1.  It used lots of sprites, and they displayed fine.

I've now moved the code over to a new computer with python 3.4 and the latest version of pyglet, and the sprites are broken.  They are displaying as black, or as transparent, or not at all -- but they aren't throwing an error.  It turns out that image.blit() works properly.  Has anyone else had this problem?  You can see a little test code here:  https://github.com/joeclark77net/roguestate/blob/master/program/sprite_test.py.  The "robot.blit()" command works, but the "sprite.draw()" command does nothing (or appears to do nothing) and throws no error.

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
flow flow | 30 Mar 19:02 2014

pyglet display mode in fullscreen

Hello,

I have a problem.
I want to go into fullscreen mode with a predefined resolution.
If I do window.set_fullscreen(True)  pyglet goes into fullscreen with the desktop resolution.

Has anyone an idea?

thanks.

best regards,
florian

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
"Juan J. Martínez" | 30 Mar 17:53 2014
Picon

Pixelated graphics and pyglet.Sprite

Hello,

I'm trying to do some pixelated graphics with pyglet and I'd love to use
the Sprite classes. Basically when the window is resized, the graphics
are scaled without any kind of aliasing/smoothing.

I'm not an opengl expert, but looks like it as easy as using
glTexParameteri to setup mag and min texture filters to GL_NEAREST.

Unfortunately it doesn't look like a simple task to do it with pyglet's
Sprites because the SpriteGroup will set the opengl state and it doesn't
support such filters (it supports blend src/dest parameters though).

The easiest way would be just patch Pyglet and move on, because I can't
seem to get it right providing a group to the Sprite class.

Instead I got it working with this:

https://gist.github.com/reidrac/9874610

I'm not completely sure I'm doing the right thing!

Ideally I would add this to the Sprite class with two new parameters:

 - mag_filer, defaults to GL_LINEAR
 - min_filer, defaults to GL_LINEAR

and both parameters will be made available for SpriteGroup to use them
in the set_state method (in the same way the blend parameters are
already in use).

I wish my opengl-fu was better so any comment will be very appreciated!

Regards,

Juan

-- 
jjm's home: http://www.usebox.net/jjm/
blackshell: http://blackshell.usebox.net/

--

-- 
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Jeff T | 29 Mar 16:55 2014
Picon

Just want to cut videos

I am trying to just cut videos based on a time stamp in Python 2.7. I would then save the resulting files as new files.

How do you do this with AVBin / Pyglet?

psuedocode:

def split_vid (list_of_time_stamps, file)
    index =0
    for time_stamp in list_of_time_stamps:
        file.cut(time_stamp)
        file.save(file.name + str(index))
        index = index+1

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
msl09 | 28 Mar 18:23 2014
Picon

stable version of pyglet

Why is the stable version of pyglet so old? What is holding back new releases?

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
claudio canepa | 25 Mar 05:16 2014
Picon

ANN: cocos 0.6.0 released


March 24, 2014 cocos 0.6.0 released

New since 0.5.5:

- Now supports directly python 2.6+ and 3.3+, no need of 2to3
- Small new features like independent scaling along the x or y axis,
persistent tint for tiles, support gzip compression in .tmx files
- bugfixing

home: http://cocos2d.org
PyPi page: https://pypi.python.org/pypi/cocos2d
NEWS: http://code.google.com/p/los-cocos/source/browse/tags/release-0.6.0/NEWS.txt

enjoy!

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.
Michael Chapman | 21 Mar 06:19 2014
Picon

Label Horizontal Alignment

I can't get the basic alignment working for my pyglet.text.Label. Does using a unicode string affect it somehow? This is how I instantiate the label.

value_weight_text = u'{:.2f}\u03b5/{:.1f}kg'.format(0,0)
self.inv_info_value_weight = pyglet.text.Label(
    value_weight_text, width=90, halign='right', batch=self.inv_batch)

Thanks.

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users+unsubscribe <at> googlegroups.com.
To post to this group, send email to pyglet-users <at> googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Gmane