[MonoTouch] A monotouch wrapper for the Sparrow 2D library

fmuaddib fmuaddib at gmail.com
Fri Feb 18 05:38:30 EST 2011


I have some problems with the dependencies. Can you put the projects
in a Mondevelop Solution (.sln)?

2011/2/17 Duane Wandless <duane at wandless.net>:
> Emanuele, I did modify AddEventListner to be more .NET like.
>
> To add an event listner:
> image.AddEventListener (doTouch, SPEvents.Touch);
> To remove:
> image.RemoveEventListner (doTouch, SPEvents.Touch);
> ---
> void doTouch (SPEvent e)
> {
>
> Works very nicely.  Have you tried using the bindings?
> Duane
> On Thu, Feb 17, 2011 at 1:14 PM, fmuaddib <fmuaddib at gmail.com> wrote:
>>
>> Great idea, maybe it could be even more simplified thank the obj-c
>> version thanks to c# predicates. I think that the monotouch platform
>> is the best for something fast and efficient like sparrow. Managing
>> iOS graphics in monotouch can be much simplier than in obj-c, like the
>> Monotouch.Dialog wrapper did for the cocoa interfaces without having
>> to write dozens of delegates and controllers!!
>>
>> If you need an hand let me know.
>> Emanuele
>>
>> 2011/2/6 Miguel de Icaza <miguel at novell.com>:
>> > Hello,
>> >
>> >> I started the bindings for Sparrow.  It looks like a good API.  The
>> >> MonoTouch project is the beginnings of the Demo app which works nicely.
>> >> https://github.com/trustme/Sparrow
>> >
>> > This looks nice!
>> >
>> > May I suggest that in SPEventDispatcher you flag the AddEventListener
>> > as internal, and expose a method that takes a delegate instead?
>> >
>> > That way users do not have to know about selectors, instances and
>> > flagging things with [Export], they would do:
>> >
>> > AddEventListener (OnBoundaryChange, "boundaryChange", true);
>> >
>> > The implementation looks like this:
>> >
>> > object AddEventListener (NSAction action, string evenType, bool retain)
>> > {
>> >    var dispatcher = new Dispatcher (action);
>> >    RealAddEventListener (Dispatcher.InvokeSelector, dispatcher,
>> > eventType, retain);
>> >    return dispatcher;
>> > }
>> >
>> > [Register ("__SparrowClassDispatcher")]
>> > class Dispatcher : NSObject {
>> >    public static Selector InvokeSelector = new Selector ("invoke");
>> >    NSAction action;
>> >    [Export ("invoke")]
>> >    public Dispatcher (NSAction action) { this.action = action; }
>> >
>> >    [Export ("apply")]
>> >    [Preserve (Conditional = true)]
>> >    public void Apply () { action (); }
>> > }
>> >
>
>


More information about the MonoTouch mailing list