newbie error compiling to neko

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

newbie error compiling to neko

jboadas
Im just playing with Haxe and in some example I managed to compile to flash and to cpp but when i try to compile to neko the compiler give me this error

293     mArena.fillRect(new Rectangle(0,0,640,480),0xE0E0ff);

src/Ski.hx:293: characters 49-57 : Int should be nme.display.BitmapInt32
src/Ski.hx:293: characters 49-57 : Int should be { rgb : Int, a : Int }
src/Ski.hx:293: characters 49-57 : Int has no field a
src/Ski.hx:293: characters 49-57 : For function argument 'inColour'

Any clues whats its going on here ?



Thanks in advance


--
Jesus Boadas
[hidden email]

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

Re: newbie error compiling to neko

postite

Neko is a server side language. As far as i know you cannot compile.to Neko using the flash lib
Cheers
Postite

Le 30 sept. 2011 18:57, "Jesus Boadas" <[hidden email]> a écrit :
> Im just playing with Haxe and in some example I managed to compile to flash
> and to cpp but when i try to compile to neko the compiler give me this error
>
>
> 293 mArena.fillRect(new Rectangle(0,0,640,480),0xE0E0ff);
>
> src/Ski.hx:293: characters 49-57 : Int should be nme.display.BitmapInt32
> src/Ski.hx:293: characters 49-57 : Int should be { rgb : Int, a : Int }
> src/Ski.hx:293: characters 49-57 : Int has no field a
> src/Ski.hx:293: characters 49-57 : For function argument 'inColour'
>

> Any clues whats its going on here ?
>
>
>
> Thanks in advance
>
>
> --
> Jesus Boadas
> [hidden email]

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

Re: newbie error compiling to neko

jboadas
Thanks.

Well I compiled almost all examples of NME whitout any problem. Im not sure but with the NME library you can access flash from neko.

salute.



2011/9/30 dav kert <[hidden email]>

Neko is a server side language. As far as i know you cannot compile.to Neko using the flash lib
Cheers
Postite

Le 30 sept. 2011 18:57, "Jesus Boadas" <[hidden email]> a écrit :

> Im just playing with Haxe and in some example I managed to compile to flash
> and to cpp but when i try to compile to neko the compiler give me this error
>
>
> 293 mArena.fillRect(new Rectangle(0,0,640,480),0xE0E0ff);
>
> src/Ski.hx:293: characters 49-57 : Int should be nme.display.BitmapInt32
> src/Ski.hx:293: characters 49-57 : Int should be { rgb : Int, a : Int }
> src/Ski.hx:293: characters 49-57 : Int has no field a
> src/Ski.hx:293: characters 49-57 : For function argument 'inColour'
>

> Any clues whats its going on here ?
>
>
>
> Thanks in advance
>
>
> --
> Jesus Boadas
> [hidden email]

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



--
Jesus Boadas
[hidden email]

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

Re: newbie error compiling to neko

Jan_Flanders
I think because neko only has 31bits ints, there is a difference in api for NME where flash stores the alpha value in(side) a Uint. You can use conditional compiler statements to differentiate between the targets:

#if flash
        mArena.fillRect(new Rectangle(0,0,640,480), 0xFFE0E0ff);//ARGB
#else
        mArena.fillRect(new Rectangle(0,0,640,480), {a:0xFF rgb:0xE0E0ff});
#end

Jan
Reply | Threaded
Open this post in threaded view
|

Re: newbie error compiling to neko

singmajesty
This sounds right.

I'm trying to learn the differences between Neko and other targets, but  
NME was named NME for "Neko Media Engine" ... just like the C++ target,  
Neko is able to read and use the native NME binaries. The difference is  
that testing in Neko can compile much faster than C++, and the error  
messages can be more verbose. I've been playing with using Neko instead of  
Flash or C++ for doing testing on my desktop, since it is an interesting  
target between Flash and C++ in terms of its time to compile and testing  
of the native libraries.

Strictly speaking, Neko does not have access to the flash.* package, but  
neither does C++. That's where NME comes in



On Sat, 01 Oct 2011 07:13:09 -0700, Jan_Flanders <[hidden email]> wrote:

> I think because neko only has 31bits ints, there is a difference in api  
> for
> NME where flash stores the alpha value in(side) a Uint. You can use
> conditional compiler statements to differentiate between the targets:
>
> #if flash
> mArena.fillRect(new Rectangle(0,0,640,480), 0xFFE0E0ff);//ARGB
> #else
> mArena.fillRect(new Rectangle(0,0,640,480), {a:0xFF rgb:0xE0E0ff});
> #end
>
> Jan
>
> --
> View this message in context:  
> http://haxe.1354130.n2.nabble.com/newbie-error-compiling-to-neko-tp6848531p6850687.html
> Sent from the Haxe mailing list archive at Nabble.com.
>


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

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

Re: newbie error compiling to neko

jboadas
Very thanks

your answers point me in the right direction and this do the trick.

    #if neko
       mArena.fillRect(new Rectangle(0, 0, 640, 480), BitmapData.createColor(0xE0E0ff,0xFF));
    #else
       mArena.fillRect(new Rectangle(0,0,640,480), 0xFFE0E0ff);//ARGB
    #end

Indeed the example runs with almost the seem basecode on flash, cpp and neko.

I just download the code from http://gm2d.com/2009/02/simple-flash-game-in-haxe/

and compile out-of-the-book

again thanks



2011/10/1 Joshua Granick <[hidden email]>
This sounds right.

I'm trying to learn the differences between Neko and other targets, but NME was named NME for "Neko Media Engine" ... just like the C++ target, Neko is able to read and use the native NME binaries. The difference is that testing in Neko can compile much faster than C++, and the error messages can be more verbose. I've been playing with using Neko instead of Flash or C++ for doing testing on my desktop, since it is an interesting target between Flash and C++ in terms of its time to compile and testing of the native libraries.

Strictly speaking, Neko does not have access to the flash.* package, but neither does C++. That's where NME comes in




On Sat, 01 Oct 2011 07:13:09 -0700, Jan_Flanders <[hidden email]> wrote:

I think because neko only has 31bits ints, there is a difference in api for
NME where flash stores the alpha value in(side) a Uint. You can use
conditional compiler statements to differentiate between the targets:

#if flash
       mArena.fillRect(new Rectangle(0,0,640,480), 0xFFE0E0ff);//ARGB
#else
       mArena.fillRect(new Rectangle(0,0,640,480), {a:0xFF rgb:0xE0E0ff});
#end

Jan

--
View this message in context: http://haxe.1354130.n2.nabble.com/newbie-error-compiling-to-neko-tp6848531p6850687.html
Sent from the Haxe mailing list archive at Nabble.com.



--
Using Opera's revolutionary email client: http://www.opera.com/mail/


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



--
Jesus Boadas
[hidden email]

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