nMagick usage, bug

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

nMagick usage, bug

NekoHaxe
Hello lists, this one is for Lee

I started using nMagick, i want to make an app to easily
create spritesheets from several images to use as csssprites.

Several questions:

Is there any example of how to use it?

and... I think I found a bug, when I call the close() method
it raises "invalid call". Inspecting the code I imagine  that

public function close() : Void
    {
        nMagick_close();
    }

should be:

public function close() : Void
    {
        nMagick_close( __m );
    }

What is the Dispose method suppoused to do?

This is a great lib, I really love imageMagick for its power
and versatility. I'll tinker with this a lot. Great job!

Carlos



¡Todo sobre Amor y Sexo!
La guía completa para tu vida en Mujer de Hoy:
http://mx.mujer.yahoo.com/

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: nMagick usage, bug

Lee Sylvester
Hey Carlos,

It's been a couple of years now, since I worked on nMagick. It really
could do with some big updates. For the most part, nMagick should still
work, but if you find any more bugs like this, let me know and I'll fix
them on SVN.  If you don't mind, I'll get to this one in the morning,
though ;-). It's midnight, here, now, and I need my bed.

Just so you know, there are a lot of drawing updates that I need to do,
including supporting ImageMagick to Neko arrays for the pixel
manipulation functions, etc.

Glad to hear you're using it, though. Since I wrote it two years ago,
you're the first to admit that to me ;-)

Kindest,
Lee




NekoHaxe wrote:

> Hello lists, this one is for Lee
>
> I started using nMagick, i want to make an app to easily
> create spritesheets from several images to use as csssprites.
>
> Several questions:
>
> Is there any example of how to use it?
>
> and... I think I found a bug, when I call the close() method
> it raises "invalid call". Inspecting the code I imagine  that
>
> public function close() : Void
>     {
>         nMagick_close();
>     }
>
> should be:
>
> public function close() : Void
>     {
>         nMagick_close( __m );
>     }
>
> What is the Dispose method suppoused to do?
>
> This is a great lib, I really love imageMagick for its power
> and versatility. I'll tinker with this a lot. Great job!
>
> Carlos
>
>
> ------------------------------------------------------------------------
>
> ¡Todo sobre Amor y Sexo!
> La guía completa para tu vida en Mujer de Hoy:
> http://mx.mujer.yahoo.com/ 


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: nMagick usage, bug

NekoHaxe
In reply to this post by NekoHaxe

A couple of years?

Then it was written future-proof as I had no trouble

compiling it for haxe 2, great work!

I made the correction in the hx files and close() now

works. I could make a tutorial on using nMagick after I discover

how to do it myself. 

Carlos


Hey Carlos,

It's been a couple of years now, since I worked on nMagick. It really 
could do with some big updates. For the most part, nMagick should still 
work, but if you find any more bugs like this, let me know and I'll fix 
them on SVN.  If you don't mind, I'll get to this one in the morning, 
though ;-). It's midnight, here, now, and I need my bed.

Just so you know, there are a lot of drawing updates that I need to do, 
including supporting ImageMagick to Neko arrays for the pixel 
manipulation functions, etc.

Glad to hear you're using it, though. Since I wrote it two years ago, 
you're the first to admit that to me ;-)

Kindest,
Lee




NekoHaxe wrote:
> Hello lists, this one is for Lee
>
> I started using nMagick, i want to make an app to easily
> create spritesheets from several images to use as csssprites.
>
> Several questions:
>
> Is there any example of how to use it?
>
> and... I think I found a bug, when I call the close() method
> it raises "invalid call". Inspecting the code I imagine  that
>
> public function close() : Void
>     {
>         nMagick_close();
>     }
>
> should be:
>
> public function close() : Void
>     {
>         nMagick_close( __m );
>     }
>
> What is the Dispose method suppoused to do?
>
> This is a great lib, I really love imageMagick for its power
> and versatility. I'll tinker with this a lot. Great job!
>
> Carlos
>
>
> ------------------------------------------------------------------------
>
> ¡Todo sobre Amor y Sexo!
> La guía completa para tu vida en Mujer de Hoy:
> http://mx.mujer.yahoo.com/ 



Hello list,
Is there a haxe library update for flex 3.0? Whats the best method of
generating hxclasses. I tried extracting the swc and running gen-hx-classes on
the swf, it did not seem to have all the mx.* packages though. I have been using
haxe to do most of flex work. I got stuck as i need to use the flex data
visualization components available only in flex 3.0. Any pointers will help.

Thanks,
Dinkar
Crax

Your probably a guru at haxe/flash or something so maybe my post is totally not
useful but just incase your a newbie at haxe like me I gather you just want to
tween stuff in flash so here's what I would suggest.

Tweener or similar is often used by flashers rather than the adobe stuff, and
the haxe Tweener one works well, it might be heavy but there is a lite compile
option, its fairly simple to use but I tend to like being obvious so here is a
recent example of me testing haxe out (nothing remotely exciting! just proof of
functioning), first you need to get Tweener

// in terminal or similar type ( I think )
haxelib install TweenerHX

and then use it, here is a simple test I was using the other day.

// compile code (Base happens to be in my namespace)
[code]
-cp net/justinfront/
-swf9 base.swf
-lib TweenerHX
-main Base.hx
-swf-header 320:240:30:3B3885
[/code]

[code]
//
//  Created by JLM at justinfront dot net
//  Base - basic test class
//  9 November 2008
//


import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.Lib;
import flash.display.Stage;
import flash.text.TextField;
import caurina.transitions.Tweener;

class Base extends Sprite
{


    private var _stage:     Stage;
    private var _txt:       TextField;
    private var _mc:        Sprite;


    public function new ():Void
    {

        super();
        _stage = Lib.current.stage;
        init();

    }

    private function init():Void
    {

        _txt        = new TextField();
        _txt.text   = "Test";
        _mc         = new Sprite();
        _mc.x       = 70;
        _mc.y       = 70;
        drawRect( _mc, 50, 50, 0xFF0000 );
        _stage.addChild( _mc );
        _stage.addChild( _txt );
        addEventListener( Event.ENTER_FRAME, rotate );
        Tweener.addTween ( _mc, { x: 200, y:100, time:2,
transition:"easeoutquad" } );
        _mc.addEventListener( MouseEvent.MOUSE_DOWN, dnPress );
        _mc.buttonMode             = true;
        _mc.mouseChildren          = false;

    }


    private function dnPress( e: MouseEvent ):Void
    {

        _txt.text = 'square pressed';


    }


    private function drawRect(
                                mc: Sprite,
                                w: Int,
                                h: Int,
                                c: Int
                                            ):Void
    {

        mc.graphics.lineStyle( 0, c, 1 );
        mc.graphics.beginFill( c, 1 );
        mc.graphics.drawRect( 0, 0, w, h );
        mc.graphics.endFill();

    }


    private function rotate( e: Event ):Void
    {

        _mc.rotation += 3;

    }


    static function main()
    {

        new Base();

    }


}
[/code]


Hope that helps otherwise you can use the classes by creating stub haxe
definitions and then using a lib to include the classes from a flash compiled
swf but tweener seems to be a simpler approach?

Cheers

;j

On 13 Nov 2008, at 12:38, CraX SUN wrote:

> Hi all,
> 
> I have got a problem when using fl.transitions, it seams haxe havn't
> packaged fl.* in the recent version?
> 
> How can i solve it except using TweenHX or FEffects.
> 
> thx
> crax
> --haXe - an open source web programming language
> http://haxe.org



I think the Python/PHP/etc kind of 'or' operator would work better.
(a or b = cast a ? a : b)

t.get (x) or "none"

read (...) or throw "error reading"


_______________________________________________
Haxe mailing list
[hidden email]
http://lists.motion-twin.com/mailman/listinfo/haxe



¡Todo sobre Amor y Sexo!
La guía completa para tu vida en Mujer de Hoy:
http://mx.mujer.yahoo.com/

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: nMagick usage, bug

Lee Sylvester
Hey Carlos,

That would be great. nMagick has a lot of uses, and is very powerful. A
tutorial might help raise awareness to that fact.

Best,
Lee




NekoHaxe wrote:

>
> A couple of /years/?
>
> Then it was written future-proof as I had no trouble
>
> compiling it for haxe 2, great work!
>
> I made the correction in the hx files and close() now
>
> works. I could make a tutorial on using nMagick after I discover
>
> how to do it myself.
>
> Carlos
>
>
>     Hey Carlos,
>
>     It's been a couple of years now, since I worked on nMagick. It really
>     could do with some big updates. For the most part, nMagick should still
>     work, but if you find any more bugs like this, let me know and I'll fix
>     them on SVN.  If you don't mind, I'll get to this one in the morning,
>     though ;-). It's midnight, here, now, and I need my bed.
>
>     Just so you know, there are a lot of drawing updates that I need to do,
>     including supporting ImageMagick to Neko arrays for the pixel
>     manipulation functions, etc.
>
>     Glad to hear you're using it, though. Since I wrote it two years ago,
>     you're the first to admit that to me ;-)
>
>     Kindest,
>     Lee
>
>
>
>
>     NekoHaxe wrote:
>     > Hello lists, this one is for Lee
>     >
>     > I started using nMagick, i want to make an app to easily
>     > create spritesheets from several images to use as csssprites.
>     >
>     > Several questions:
>     >
>     > Is there any example of how to use it?
>     >
>     > and... I think I found a bug, when I call the close() method
>     > it raises "invalid call". Inspecting the code I imagine  that
>     >
>     > public function close() : Void
>     >     {
>     >         nMagick_close();
>     >     }
>     >
>     > should be:
>     >
>     > public function close() : Void
>     >     {
>     >         nMagick_close( __m );
>     >     }
>     >
>     > What is the Dispose method suppoused to do?
>     >
>     > This is a great lib, I really love imageMagick for its power
>     > and versatility. I'll tinker with this a lot. Great job!
>     >
>     > Carlos
>     >
>     >
>     > ------------------------------------------------------------------------
>     >
>     > ¡Todo sobre Amor y Sexo!
>     > La guía completa para tu vida en Mujer de Hoy:
>     > http://mx.mujer.yahoo.com/ 
>
>
>
>              
>
>     Hello list,
>     Is there a haxe library update for flex 3.0? Whats the best method of
>     generating hxclasses. I tried extracting the swc and running gen-hx-classes on
>     the swf, it did not seem to have all the mx.* packages though. I have been using
>     haxe to do most of flex work. I got stuck as i need to use the flex data
>     visualization components available only in flex 3.0. Any pointers will help.
>
>     Thanks,
>     Dinkar
>              
>
>     Crax
>
>     Your probably a guru at haxe/flash or something so maybe my post is totally not
>     useful but just incase your a newbie at haxe like me I gather you just want to
>     tween stuff in flash so here's what I would suggest.
>
>     Tweener or similar is often used by flashers rather than the adobe stuff, and
>     the haxe Tweener one works well, it might be heavy but there is a lite compile
>     option, its fairly simple to use but I tend to like being obvious so here is a
>     recent example of me testing haxe out (nothing remotely exciting! just proof of
>     functioning), first you need to get Tweener
>
>     // in terminal or similar type ( I think )
>     haxelib install TweenerHX
>
>     and then use it, here is a simple test I was using the other day.
>
>     // compile code (Base happens to be in my namespace)
>     [code]
>     -cp net/justinfront/
>     -swf9 base.swf
>     -lib TweenerHX
>     -main Base.hx
>     -swf-header 320:240:30:3B3885
>     [/code]
>
>     [code]
>     //
>     //  Created by JLM at justinfront dot net
>     //  Base - basic test class
>     //  9 November 2008
>     //
>
>
>     import flash.display.Sprite;
>     import flash.events.Event;
>     import flash.events.MouseEvent;
>     import flash.Lib;
>     import flash.display.Stage;
>     import flash.text.TextField;
>     import caurina.transitions.Tweener;
>
>     class Base extends Sprite
>     {
>
>
>         private var _stage:     Stage;
>         private var _txt:       TextField;
>         private var _mc:        Sprite;
>
>
>         public function new ():Void
>         {
>
>             super();
>             _stage = Lib.current.stage;
>             init();
>
>         }
>
>         private function init():Void
>         {
>
>             _txt        = new TextField();
>             _txt.text   = "Test";
>             _mc         = new Sprite();
>             _mc.x       = 70;
>             _mc.y       = 70;
>             drawRect( _mc, 50, 50, 0xFF0000 );
>             _stage.addChild( _mc );
>             _stage.addChild( _txt );
>             addEventListener( Event.ENTER_FRAME, rotate );
>             Tweener.addTween ( _mc, { x: 200, y:100, time:2,
>     transition:"easeoutquad" } );
>             _mc.addEventListener( MouseEvent.MOUSE_DOWN, dnPress );
>             _mc.buttonMode             = true;
>             _mc.mouseChildren          = false;
>
>         }
>
>
>         private function dnPress( e: MouseEvent ):Void
>         {
>
>             _txt.text = 'square pressed';
>
>
>         }
>
>
>         private function drawRect(
>                                     mc: Sprite,
>                                     w: Int,
>                                     h: Int,
>                                     c: Int
>                                                 ):Void
>         {
>
>             mc.graphics.lineStyle( 0, c, 1 );
>             mc.graphics.beginFill( c, 1 );
>             mc.graphics.drawRect( 0, 0, w, h );
>             mc.graphics.endFill();
>
>         }
>
>
>         private function rotate( e: Event ):Void
>         {
>
>             _mc.rotation += 3;
>
>         }
>
>
>         static function main()
>         {
>
>             new Base();
>
>         }
>
>
>     }
>     [/code]
>
>
>     Hope that helps otherwise you can use the classes by creating stub haxe
>     definitions and then using a lib to include the classes from a flash compiled
>     swf but tweener seems to be a simpler approach?
>
>     Cheers
>
>     ;j
>
>     On 13 Nov 2008, at 12:38, CraX SUN wrote:
>
>     > Hi all,
>     >
>     > I have got a problem when using fl.transitions, it seams haxe havn't
>     > packaged fl.* in the recent version?
>     >
>     > How can i solve it except using TweenHX or FEffects.
>     >
>     > thx
>     > crax
>     > --haXe - an open source web programming language
>     > http://haxe.org
>
>
>
>              
>
>     I think the Python/PHP/etc kind of 'or' operator would work better.
>     (a or b = cast a ? a : b)
>
>     t.get (x) or "none"
>
>     read (...) or throw "error reading"
>
>
>              
>
>     _______________________________________________
>     Haxe mailing list
>     [hidden email]
>     http://lists.motion-twin.com/mailman/listinfo/haxe
>              
>
>
> ------------------------------------------------------------------------
>
> ¡Todo sobre Amor y Sexo!
> La guía completa para tu vida en Mujer de Hoy:
> http://mx.mujer.yahoo.com/ 


--
haXe - an open source web programming language
http://haxe.org