Hi everyone,
During last changes image stuff got broken, now I think I have fixed it.
It happened that the fact of grouping all import statements at the
beginning of data.py file triggered a problem that was potentially
already there (shame on me): having a class called "Image" and importing
"Image" PIL module with the same name was actually a perfect way of
making a mess in namespace, but having the import statement embedded
into the function was hiding it up to now. Now Image module is imported
as "PILImage" in order to avoid confusion with shoebot Image class.
Ricardo: I'm sorry for the problem with the font() command.
I will try to have a look at it. Do you have the same problem even
setting the font directly inside the text() command? (this way it works
for me)
Please, pull changes from official repository and test if image() is
really fixed.
best to all,
francesco
Il giorno gio, 07/05/2009 alle 17.59 +0100, ricardo lafuente ha scritto:
> hai,
>
> i've just pushed some changes to the main tree to have keyboard
> interaction. (btw, also properly arranged import statements in all
> files, as well as license text, on to update the Freshmeat entry for
> Shoebot)
>
> also added an example of key interaction in examples/misc/keyboard.bot,
> pasted here:
>
> # keyboard interaction example
>
> def setup():
> size(300,300)
> font('NotCourier-sans', 80)
>
> def draw():
> # make text flash if a key is pressed
> if keydown:
> fill(1,0,0)
> else:
> fill(0)
> # use the currently pressed key as text
> text(key, 20, 70)
> # comment the previous line and uncomment the next one to show
> the keycodes
> # text(keycode, 20, 70)
>
> Francesco: i'm totally in love with your text() implementation now that
> i've gotten to work more with it! One little issue i found (annotated in
> the example script) is that if you have 2 font() calls in the same
> script, it makes all the text instances use the last font specified.
> Maybe they're sharing something instead of specifying one font instance
> for each text object? I looked into Text() but couldn't find anything
> suspicious.
>
> Tristan, if you want to try this, you just have to check out the latest
> version from our repository. Not sure if this is how you're doing it,
> but here's the steps:
>
> 1. If you installed shoebot through a package manager, it's better to
> uninstall it (not sure what you might run into if you keep it, but i
> don't think it's a good idea)
> 2. Using the terminal, get a copy of the most recent version from the
> repository and place it anywhere (a temporary place in your home dir
> would be the best idea, i think):
> hg clone https://code.goto10.org/hg/shoebot shoebot
> 3. Install shoebot:
> cd shoebot
> sudo python setup.py install
>
> Let me know if that worked out for you :)
> :r
>
>
> hxgraphics wrote:
> > This link contains the Nodebox documentation I mentioned:
> > http://nodebox.net/code/index.php/Interaction
> >
> > I tried to capture my key-presses using something like this:
> > -- using Nodebox, the key I pressed is printed, but Shoebot does not
> > recognize "key"
> >
> > speed(30)
> > def draw():
> > print key
> >
> >
> >
> >
> > Stuart Axon wrote:
> >
> >> It's not supported at the moment, but it should be fairly easy to add
> >> (the shoebot code is fairly easy to get started with). It's a case of
> >> looking at
> >> how to get the keyboard values from pygtk.
> >>
> >> If I get time, I may look into this; is there a specific example you can
> >> point
> >> to that uses these ?
> >>
> >>
> >>
> >> ----- Original Message ----
> >> From: hxgraphics <[email protected]>
> >> To: [email protected]
> >> Sent: Wednesday, April 22, 2009 8:51:06 PM
> >> Subject: [shoebot-devel] Keyboard Interaction?
> >>
> >>
> >> Following the Nodebox documentation, I was able to use the following for
> >> mouse interaction with Shoebot:
> >> MOUSEX, MOUSEY, mousedown
> >>
> >> but the following predefined variables for keyboard interaction do not
> >> appear to be supported:
> >> key, keycode, keydown
> >>
> >> Have I made a silly mistake here? Or is the Shoebot implementation for
> >> keyboard interaction different -- or possibly, not-existent? If so, do you
> >> plan to implement keyboard interaction in the future?
> >>
> >> I will be delivering a Shoebot course for my students this year as a
> >> precursor to JavaScript and ActionScript. Regardless of whether or not
> >> keyboard interaction is available, the course will go ahead. Your
> >> cross-platform, python-based graphics robot was EXACTLY what I was looking
> >> for!
> >>
> >> Keep up the great work!
> >> --
> >> View this message in context:
> >> http://n2.nabble.com/Keyboard-Interaction--tp2678373p2678373.html
> >> Sent from the ShoeBot mailing list archive at Nabble.com.
> >>
> >> _______________________________________________
> >> Shoebot-devel mailing list
> >> [email protected]
> >> http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> Shoebot-devel mailing list
> >> [email protected]
> >> http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
> >>
> >>
> >>
> >
> >
>
> _______________________________________________
> Shoebot-devel mailing list
> [email protected]
> http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net
_______________________________________________
Shoebot-devel mailing list
[email protected]
http://lists.tinkerhouse.net/listinfo.cgi/shoebot-devel-tinkerhouse.net