René Dudfield | 1 Jul 14:09 2011
Picon

Re: Conversions for pygame.Movie

Hey,

I'll put this in the docs this weekend.

cu.



On Thu, Jun 30, 2011 at 2:45 AM, Lenard Lindstrom <len-l-EynCeXvFgoheoWH0uzbU5w@public.gmane.org> wrote:
Hi,


On 24/06/11 12:16 PM, Scribble Master wrote:
What is a working ffmpeg command to convert videos for pygame.Movie()?
Using -target ntsc-vcd works, but the bitrate is immutable, which is not good for higher qualities.
Simply using -vcodec mpeg1video makes pygame.Movie throw
warning: picture block before sequence header block
and not play the video.

ffmpeg -i <infile> -vcodec mpeg1video -acodec libmp3lame -intra <outfile.mpg>

Lenard Lindstrom

Picon

Re: Pygame-UI: UI Component Framework for python and pygame

I have to do a UI for my game cause y want to costumize a lot of the menus.... I've done 3 (3!!!) almost funtional (with menus, checks, radios and animations) but while I'm programing my game for fun it must be almost perfect.

I'll download the code and take a look on it this afternoon.


2011/6/29 <info-i5MZyycMS6ssKmbATAwz5w@public.gmane.org>
Hello users and developers,

I am sending this email because I have recently started working on a UI Component framework on top of pygame. I started this project because I have been a user of python and pygame for quite a while now and I felt like there was a need for an extensive library that provides an easy access to basic and more complex user interface components such a buttons, input boxes, dialog windows, menus, etc. I would like to hear feedback on the primary implementation and to potentially get people involved with this project. Currently I have a basic implementation of the base classes as well as a few components that are already usable.

The project home is: http://www.sarconsrealm.org/CodeProjects/pygame-ui/

Again I would appreciate any feedback as well as requests to join on the development. The source code is subversioned under google code and there is a link to it in the project homepage.

Thank you for your time!



--
Nota: Tildes omitidas para evitar incompatibilidades.

:wq
Lenard Lindstrom | 1 Jul 17:28 2011
Picon

Re: Conversions for pygame.Movie

Hi,

It already is there. I put it in earlier this year.

Lenard

On 01/07/11 05:09 AM, René Dudfield wrote:
> Hey,
>
> I'll put this in the docs this weekend.
>
> cu.
>
>
>
> On Thu, Jun 30, 2011 at 2:45 AM, Lenard Lindstrom <len-l@... 
> <mailto:len-l@...>> wrote:
>
>     Hi,
>
>
>     On 24/06/11 12:16 PM, Scribble Master wrote:
>
>         What is a working ffmpeg command to convert videos for
>         pygame.Movie()?
>         Using -target ntsc-vcd works, but the bitrate is immutable,
>         which is not good for higher qualities.
>         Simply using -vcodec mpeg1video makes pygame.Movie throw
>         warning: picture block before sequence header block
>         and not play the video.
>
>     ffmpeg -i <infile> -vcodec mpeg1video -acodec libmp3lame -intra
>     <outfile.mpg>
>
>     Lenard Lindstrom
>
>

info | 1 Jul 18:50 2011

Re: Re: Pygame-UI: UI Component Framework for python and pygame

Hi there,

I want to tell you that the code is currently in development, but I would try to develop a working and stylable menu for you in the next few days. I would also make a combined file on the Components so that it is easily importable and usable. Do you need a hierarchical menu or a flat menu to start with? Checkboxes and radios would be easy to implement and the images for them aren't that hard to come up with.

Here comes my question: Do you prefer callbacks or custom component events when using such a framework, because I have currently implemented callbacks but I intend to change it to events say clicking on a button pushes UIComponentClick with the component reference as argument.

Best regards,
Konstantin Dinev

---- OriginalMessage ----
From: "inigo.delgado-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <inigo.delgado-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pygame-users-eePT7DaMpNY@public.gmane.org
Sent: Fri, Jul 01, 2011, 05:35 AM
Subject: Re: [pygame] Pygame-UI: UI Component Framework for python and pygame

I have to do a UI for my game cause y want to costumize a lot of the menus.... I've done 3 (3!!!) almost funtional (with menus, checks, radios and animations) but while I'm programing my game for fun it must be almost perfect.

I'll download the code and take a look on it this afternoon.


2011/6/29 <info-i5MZyycMS6ssKmbATAwz5w@public.gmane.org>
Hello users and developers,

I am sending this email because I have recently started working on a UI Component framework on top of pygame. I started this project because I have been a user of python and pygame for quite a while now and I felt like there was a need for an extensive library that provides an easy access to basic and more complex user interface components such a buttons, input boxes, dialog windows, menus, etc. I would like to hear feedback on the primary implementation and to potentially get people involved with this project. Currently I have a basic implementation of the base classes as well as a few components that are already usable.

The project home is: http://www.sarconsrealm.org/CodeProjects/pygame-ui/

Again I would appreciate any feedback as well as requests to join on the development. The source code is subversioned under google code and there is a link to it in the project homepage.

Thank you for your time!



--
Nota: Tildes omitidas para evitar incompatibilidades.

:wq
Picon

Re: Re: Pygame-UI: UI Component Framework for python and pygame

Events:

I dont understand what do you want to do know. I'd do callbacks -like you have- and are pretty flexible. (and you should do a callback from a collection to its childs if and only if the mouse is in -over- the container, if it's out of collection is out of its childs) But I dont understand what you want to do with 'change to events'.

To have all items in an.... array... and test if the clisk is done over all of them?

I prefer callbacks...

Menu:

Buf... have to go. Let's say that I want a phone-friendly menu (clipable, scrollable and with submenus that way:

1 menu item
2 menu submenu item
3 menu item

1 menu item
2 menu submenu item
  2.1 submenu item
  2.2 submenu item
3 menu item

)

Also the submenus should can be opened in standar way for a standar menu in a cool GUI...


1 menu item
2 menu submenu item
3 menu item

1 menu item
2 menu submenu item 2.1 submenu item
3 menu item               2.2 submenu item

As said, i've to go.

:wq

Agur


2011/7/1 <info-i5MZyycMS6ssKmbATAwz5w@public.gmane.org>
Hi there,

I want to tell you that the code is currently in development, but I would try to develop a working and stylable menu for you in the next few days. I would also make a combined file on the Components so that it is easily importable and usable. Do you need a hierarchical menu or a flat menu to start with? Checkboxes and radios would be easy to implement and the images for them aren't that hard to come up with.

Here comes my question: Do you prefer callbacks or custom component events when using such a framework, because I have currently implemented callbacks but I intend to change it to events say clicking on a button pushes UIComponentClick with the component reference as argument.

Best regards,
Konstantin Dinev

---- OriginalMessage ----
From: "inigo.delgado-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <inigo.delgado-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pygame-users-eePT7DaMpNY@public.gmane.org
Sent: Fri, Jul 01, 2011, 05:35 AM
Subject: Re: [pygame] Pygame-UI: UI Component Framework for python and pygame


I have to do a UI for my game cause y want to costumize a lot of the menus.... I've done 3 (3!!!) almost funtional (with menus, checks, radios and animations) but while I'm programing my game for fun it must be almost perfect.

I'll download the code and take a look on it this afternoon.


2011/6/29 <info-i5MZyycMS6ssKmbATAwz5w@public.gmane.org>
Hello users and developers,

I am sending this email because I have recently started working on a UI Component framework on top of pygame. I started this project because I have been a user of python and pygame for quite a while now and I felt like there was a need for an extensive library that provides an easy access to basic and more complex user interface components such a buttons, input boxes, dialog windows, menus, etc. I would like to hear feedback on the primary implementation and to potentially get people involved with this project. Currently I have a basic implementation of the base classes as well as a few components that are already usable.

The project home is: http://www.sarconsrealm.org/CodeProjects/pygame-ui/

Again I would appreciate any feedback as well as requests to join on the development. The source code is subversioned under google code and there is a link to it in the project homepage.

Thank you for your time!



--
Nota: Tildes omitidas para evitar incompatibilidades.

:wq



--
Nota: Tildes omitidas para evitar incompatibilidades.

:wq
James Mazer | 1 Jul 23:20 2011
Picon

deiconify method?

I think I must be missing something obvious, but years of pygame
programming and an hour of googling and I still can't figure out
the inverse of pygame.display.iconify()...

Is there a way to *deiconify* the pygame window without doing
something ugly like calling quit() and set_mode() again?

Thanks,
/jamie

--

-- 
James Mazer
Department of Neurobiology
Yale School of Medicine
phone: 203-737-5853
fax: 203-785-5263

Brian Fisher | 2 Jul 00:59 2011

Re: deiconify method?

You're not missing anything obvious. There is no method to de-iconify, because the underlying SDL library had no method to de-iconify.

I think the reason for that may be that there weren't programmatic de-iconify methods on all platforms - the operating system window managers usually don't want apps to be able to activate themselves and steal focus, because it's generally considered bad form and annoying to the user if apps do that.

You might be able to get this going with ctypes calling platform specific stuff withyour window handle from the pygame.display.get_wm_info() function

I think windows has a deiconify call (ShowWindow with the correct SW_ flag), but I think it only works if your window is already active, otherwise it makes your bar blink blue or something - basically it just lets you politely ask to be un-minimized - the user must be the one to actually un-minimize the app.


On Fri, Jul 1, 2011 at 2:20 PM, James Mazer <james.mazer-LrD5EImo2rg@public.gmane.org> wrote:
I think I must be missing something obvious, but years of pygame
programming and an hour of googling and I still can't figure out
the inverse of pygame.display.iconify()...

Is there a way to *deiconify* the pygame window without doing
something ugly like calling quit() and set_mode() again?

Thanks,
/jamie

--
James Mazer
Department of Neurobiology
Yale School of Medicine
phone: 203-737-5853
fax: 203-785-5263

info | 2 Jul 00:50 2011

Re: Re: Re: Pygame-UI: UI Component Framework for python and pygame

Ok about menu, you meant a full hierarchical menu. About the callback I would keep the callback system and still implement an events system. If you want to start the menu implementation yourself feel free to do so but still we should probably have a talk about how to inherit the base component. I can however implement such a menu in a rather short time so in any way feel free to contact me at Skype: sauron_bg


---- OriginalMessage ----
From: "inigo.delgado-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <inigo.delgado-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pygame-users-eePT7DaMpNY@public.gmane.org
Sent: Fri, Jul 01, 2011, 11:50 AM
Subject: Re: Re: [pygame] Pygame-UI: UI Component Framework for python and pygame

Events:

I dont understand what do you want to do know. I'd do callbacks -like you have- and are pretty flexible. (and you should do a callback from a collection to its childs if and only if the mouse is in -over- the container, if it's out of collection is out of its childs) But I dont understand what you want to do with 'change to events'.

To have all items in an.... array... and test if the clisk is done over all of them?

I prefer callbacks...

Menu:

Buf... have to go. Let's say that I want a phone-friendly menu (clipable, scrollable and with submenus that way:

1 menu item
2 menu submenu item
3 menu item

1 menu item
2 menu submenu item
  2.1 submenu item
  2.2 submenu item
3 menu item

)

Also the submenus should can be opened in standar way for a standar menu in a cool GUI...


1 menu item
2 menu submenu item
3 menu item

1 menu item
2 menu submenu item 2.1 submenu item
3 menu item               2.2 submenu item

As said, i've to go.

:wq

Agur


2011/7/1 <info-i5MZyycMS6ssKmbATAwz5w@public.gmane.org>
Hi there,

I want to tell you that the code is currently in development, but I would try to develop a working and stylable menu for you in the next few days. I would also make a combined file on the Components so that it is easily importable and usable. Do you need a hierarchical menu or a flat menu to start with? Checkboxes and radios would be easy to implement and the images for them aren't that hard to come up with.

Here comes my question: Do you prefer callbacks or custom component events when using such a framework, because I have currently implemented callbacks but I intend to change it to events say clicking on a button pushes UIComponentClick with the component reference as argument.

Best regards,
Konstantin Dinev

---- OriginalMessage ----
From: "inigo.delgado <at> gmail.com" <inigo.delgado-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: pygame-users-E1LycgO7vAA@public.gmane.orgg
Sent: Fri, Jul 01, 2011, 05:35 AM
Subject: Re: [pygame] Pygame-UI: UI Component Framework for python and pygame


I have to do a UI for my game cause y want to costumize a lot of the menus.... I've done 3 (3!!!) almost funtional (with menus, checks, radios and animations) but while I'm programing my game for fun it must be almost perfect.

I'll download the code and take a look on it this afternoon.


2011/6/29 <info <at> sarconsrealm.org>
Hello users and developers,

I am sending this email because I have recently started working on a UI Component framework on top of pygame. I started this project because I have been a user of python and pygame for quite a while now and I felt like there was a need for an extensive library that provides an easy access to basic and more complex user interface components such a buttons, input boxes, dialog windows, menus, etc. I would like to hear feedback on the primary implementation and to potentially get people involved with this project. Currently I have a basic implementation of the base classes as well as a few components that are already usable.

The project home is: http://www.sarconsrealm.org/CodeProjects/pygame-ui/

Again I would appreciate any feedback as well as requests to join on the development. The source code is subversioned under google code and there is a link to it in the project homepage.

Thank you for your time!



--
Nota: Tildes omitidas para evitar incompatibilidades.

:wq



--
Nota: Tildes omitidas para evitar incompatibilidades.

:wq
Jake b | 2 Jul 03:53 2011
Picon

Re: Pygame-UI: UI Component Framework for python and pygame

How do you plan on drawing?

You mentioned styling. I suggest using properties and values in the same format as CSS2.1 ( http://www.w3.org/TR/CSS21/ ), where possible.

This would allow more users to immediately style the UI, without having to know much of the iternals.
You can get quite complex looking results with a few simple properties: ( http://www.w3.org/TR/css3-background/#border-images )


Example: One single rectangle ends up like this:

Details: uses an image sliced into 9 pieces.

Here's a class I started, some if it is psuedo code, but you should get the idea.

# 2011/06/30 ninmonkey
# StyleCSS for ui.
import pygame
from pygame.locals import *
from pygame import Color

# valid size-types for font, border, width, etc.
valid_sizes = ['px', '%', 'pt', 'em']

# which CSS2 andor 3 properties actually do anything ATM.
implemented_css_properties = ['border-width',
    'border-width-top', 'border-width-right', 'border-width-bottom', 'border-width-left',
    'font-size',
    'color', 'background-color']
# non-standard style info, that is implemented.
implemented_extra_properties = ['foo', 'bar', 'icon', 'alert-box']

class StyleCSS(object):
    """
    methods:
    members:
        default_size:   one of a valid_size, used on all values. ( border width, font size, etc..)
    """
   
    def __init__(self, parent):
        self.default_size = 'px'
        self.parent = parent
        # copy parent style data
       
    def clear(self):
        """reset / empty self, and reload values from parent style"""
        # reset, then reinit
       
    def set_property(self, prop, value):
        """based on property name, read value differently, and save data."""
        if not prop in self.implemented_css2_properties or
            not prop in self.implemented_extra_properties: return
           
        # based on property name
        if prop == 'color':
            # = pygame.Color(value)
        elif prop == 'border-width':
            #
        elif prop == 'border-left-width':
            # ...
       
    def load_as_str(self, strcss):
        """load a string containing real a string of real style.css text.
       
        note:
            expects style info, without selectors, and without brackets.
        example:       
            strcss = "font-size: 20px; color-bg: grey; color: white;"
           
        Also:
            allows you to save presets, that can append eachother, saving to files, and mix-match like selectors can.  ( ie: content-main.css, inventory-window-base.css, inventory-bags.css, text-big.css, text-small.css, text-sans.css, text-serif.css)"""
        self.reset()
       
        # split to rules
        # collapse whitespace
        rules = strcss.split(';')
        # get (prop, str)
        for r in rules:
            prop, str = r.split(':')
            self.set_property(prop, str)
       
    def append_str(self, strcss):
        """like load_as_str() , but does NOT destroy current style info.
        convienence when needing multiple size unit types.
        """
        pass

# example use

class BaseWidgit():
    def __init__(self, ...):
        self.style = StyleCSS(parent.style)
        # defaults to *derives style* from parent,
        # then self only has to *override specific* values
        self.style.font_size = 20
        base_css = """font-size: 14px; font-family: Verdana, sans-serif;"""
        self.style.append_str(base_css)
       
class PlayerInventoryWindow(BaseWindow):
    def __init__(self, ...):
        self.style = StyleCSS(parent)
        self.style.load_as_str( filename='window-base.css' )

# example property use:
    # maybe not as needed, but would make some modifications easier.
    # like if player wants to change border-color: when player hover's.
    # or k_minus will increment: font-size += 2
    """
    = css property: border-width =
        format is: Top Right; and Top Right Bottom Left;
   
        border-width: 2 1;
        border-width: 2, 1, 2, 1;
    """   
    # these are equivalent
    style.border_width = (2, 1)
    style.border_width = (2, 1, 2, 1)
       
    # they set all these.
    # same as expected for CSS2.1 spec
    style.border_top_width = 2
    style.border_right_width = 1
    style.border_bottom_width = 2
    style.border_left_width = 1   
--
Jake
René Dudfield | 2 Jul 09:56 2011
Picon

Re: Conversions for pygame.Movie


On Fri, Jul 1, 2011 at 4:28 PM, Lenard Lindstrom <len-l <at> telus.net> wrote:
Hi,

It already is there. I put it in earlier this year.

Lenard

oh, hehe.  nice.

Gmane