Does using libraries restrict target platform choices?

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

Does using libraries restrict target platform choices?

Matthew Wensing
Novice question here--but if I use flash.Lib (for ex. the Flash drawing API) in my haxe code, does that mean that I can't use that same haxe code then to target, say, JavaScript or cpp (iPhone)?  Are you committed to a certain target once you start using certain libraries?

My task is to migrate 40,000 lines of AS2 to haxe.

Matt


--
Matthew Wensing
Co-founder, Stormpulse
561.602.4647
http://www.linkedin.com/in/wensing

What if weather maps inspired confidence instead of confusion?


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

Re: Does using libraries restrict target platform choices?

David Peek
Hi Matt,

Libraries like jeash and NME replicate the subsets of the ActionScript API, including display list and graphics, for the JavaScript (using canvas) and C++ (using SDL) targets. Some libraries are platform specific for performance of platform reasons of course.

Hope that helps.
David

On 08/12/2010, at 2:23 PM, Matthew Wensing wrote:

Novice question here--but if I use flash.Lib (for ex. the Flash drawing API) in my haxe code, does that mean that I can't use that same haxe code then to target, say, JavaScript or cpp (iPhone)?  Are you committed to a certain target once you start using certain libraries?

My task is to migrate 40,000 lines of AS2 to haxe.

Matt


--
Matthew Wensing
Co-founder, Stormpulse
561.602.4647
http://www.linkedin.com/in/wensing

What if weather maps inspired confidence instead of confusion?

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


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

Re: Does using libraries restrict target platform choices?

Tony Polinelli
So basically, some libraries are crosstarget and some arnt. If you use cross target libraries, then you wont be restricted.

Often, your code might be quite abstract and not need target specific calls, and sometimes it is good (and easiest) just to target one platform.

In the case of drawing (for example) there are a few other libraries which abstract the platform specific commands to be crosstarget.



On Wed, Dec 8, 2010 at 2:36 PM, David Peek <[hidden email]> wrote:
Hi Matt,

Libraries like jeash and NME replicate the subsets of the ActionScript API, including display list and graphics, for the JavaScript (using canvas) and C++ (using SDL) targets. Some libraries are platform specific for performance of platform reasons of course.

Hope that helps.
David

On 08/12/2010, at 2:23 PM, Matthew Wensing wrote:

Novice question here--but if I use flash.Lib (for ex. the Flash drawing API) in my haxe code, does that mean that I can't use that same haxe code then to target, say, JavaScript or cpp (iPhone)?  Are you committed to a certain target once you start using certain libraries?

My task is to migrate 40,000 lines of AS2 to haxe.

Matt


--
Matthew Wensing
Co-founder, Stormpulse
561.602.4647
http://www.linkedin.com/in/wensing

What if weather maps inspired confidence instead of confusion?

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


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



--
Tony Polinelli
http://touchmypixel.com

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

Re: Does using libraries restrict target platform choices?

singmajesty
You should be able to use the .graphics property of the Sprite class to  
draw graphics which are compatible with CPP, JS and Flash, though bitmaps  
do perform better than drawn graphics in C++


On Tue, 07 Dec 2010 20:10:43 -0800, Tony Polinelli  
<[hidden email]> wrote:

> So basically, some libraries are crosstarget and some arnt. If you use  
> cross
> target libraries, then you wont be restricted.
>
> Often, your code might be quite abstract and not need target specific  
> calls,
> and sometimes it is good (and easiest) just to target one platform.
>
> In the case of drawing (for example) there are a few other libraries  
> which
> abstract the platform specific commands to be crosstarget.
>
>
>
> On Wed, Dec 8, 2010 at 2:36 PM, David Peek  
> <[hidden email]>wrote:
>
>> Hi Matt,
>>
>> Libraries like jeash and NME replicate the subsets of the ActionScript  
>> API,
>> including display list and graphics, for the JavaScript (using canvas)  
>> and
>> C++ (using SDL) targets. Some libraries are platform specific for
>> performance of platform reasons of course.
>>
>> Hope that helps.
>> David
>>
>> On 08/12/2010, at 2:23 PM, Matthew Wensing wrote:
>>
>> Novice question here--but if I use flash.Lib (for ex. the Flash drawing
>> API) in my haxe code, does that mean that I can't use that same haxe  
>> code
>> then to target, say, JavaScript or cpp (iPhone)?  Are you committed to a
>> certain target once you start using certain libraries?
>>
>> My task is to migrate 40,000 lines of AS2 to haxe.
>>
>> Matt
>>
>>
>> --
>> Matthew Wensing
>> Co-founder, Stormpulse
>> 561.602.4647
>> http://www.linkedin.com/in/wensing
>>
>> What if weather maps inspired confidence instead of confusion?
>>
>>  --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>>
>
>
>


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

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