Hi,

cogl.clip_set(0, 0, clutter.units_from_int(50), clutter.units_from_int(50))

should do the trick.

:wq buz


On Tue, Jan 27, 2009 at 04:17:16PM +0100, Thomas Steinacher wrote:
> Hello,
> 
> The following code displays a blank stage (i.e. the image is not
> rendered at all). Why is this so? I'd expect a 50x50 rectangle to be
> visible.
> 
> 
> import clutter
> from clutter import cogl
> 
> class Texture(clutter.Texture):
>     __gtype_name__ = 'Texture'
> 
>     def do_paint(self):
>         cogl.push_matrix()
>         cogl.clip_set(0, 0, 50, 50)
>         clutter.Texture.do_paint(self)
>         cogl.clip_unset()
>         cogl.pop_matrix()
> 
> stage = clutter.Stage()
> stage.set_size(640, 480)
> stage.connect('key-press-event', clutter.main_quit)
> 
> tex = Texture('image.png')
> tex.set_size(200, 200)
> stage.add(tex)
> 
> stage.show_all()
> clutter.main()
> 
> 
> 
> Thomas
> -- 
> To unsubscribe send a mail to [email protected]
> 

-- 
GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0  FD53 8C35 FD2E 6908 7B82

Attachment: signature.asc
Description: Digital signature

Reply via email to