Profile

Member Since
November 28, 2011

Search Members

  

crayfellow

204
@

Badges

This user hasn't earned any badges yet.

Posts

Viewing 21 to 40 (204 Total)

Re: Stuttering movement with touch events on iPod Touch

Jon, I am assuming you have tried editing the default scheme and changing the "Build Configuration" to "Release" as opposed to "Debug". Is this the case?

Posted on July 31, 2012 at 8:28 PM

Re: ios GCInternal warning

this should work in its place for clang, which is the compiler in question:


#if __has_builtin(__builtin_trap)
__builtin_trap();
#else
*(int *)0=0;
#endif

with this toward the top to make sure __has_builtin is defined:

#ifndef __has_builtin // Optional of course.
#define __has_builtin(x) 0 // Compatibility with non-clang compilers.
#endif

Posted on July 31, 2012 at 5:20 PM

Re: Sound in HTML5: this.jeashAudio.load() - Uncaught TypeError: Cannot call method 'load' of null

The first thing (which you probably already know) is that sound in HTML5 is still pretty wonky across browsers. Getting it to work is a bit of a trick unfortunately, and some mobile browsers (such as iOS) refuse to play media unless the play command is in synchrony with user action such as a click handler. This makes programmatic audio difficult for advanced applications.

It looks like what you are encountering is a bug in the stalled handler in SoundChannel. The reason it is working anyway is that the HTML5 audio doesn't necessarily have to be retold to load when it stalls, it may and usually does continue loading and playing.

For what it's worth, I ran your example in Chrome and saw no such error/warning because it did not happen to stall during load/play.

Regardless, I'm going to fix the issue.

Cheers,
Patrick

Posted on July 30, 2012 at 9:21 AM

Re: Unit Test Support

Hugh, that is a good idea just to keep it in the current class file with a switch to enable when the lib is present.

As for the built-in haxe unit testing I believe utest and munit both add important and useful functionality, but I'm considering all options. I think Franco's utest is a nice blend of simplicity and functionality. mtest is cool because it is heading toward a lot of CI integration like reporting and integration with headless browser (via phantomjs) but I've had trouble using the munit server component (possibly user error).

Posted on July 28, 2012 at 10:16 AM

Re: NME Bugs

Ideally, everything would be in one central place to manage and track, to make it easier for users if nothing else.

Atlassian donated their entire suite to the project, so at some point the source code repository could be migrated there as well, which would allow us to tie changesets directly to bug fixes, progress toward fixes, or feature work. The agile plugin "GreenHopper" is also included.

Because this is a community effort, some seemed to prefer using the forum and/or the googlecode bug reporting tool so some of that has still stuck around. It would take a consensus to switch to atlassian for bug reporting and source control completely, but that would be my personal preference as although it may not be the ideal it is a simple and consistent solution.

Out of respect for Hugh who initiated and still contributes core functionality to this project it would ultimately be his call.

Patrick

Posted on July 28, 2012 at 10:12 AM

Re: Stuttering movement with touch events on iPod Touch

Often there are more than one touch/mouse move events in a given frame, so if you are redrawing on each touch/mouse move, you can improve performance by only responding to the latest mouse move per rendering frame. Another trick if you have multiple objects is to keep track of which ones need to be redrawn with some sort of graphics invalidation flag (perhaps with a separate flag for transformation invalidation), so you can restrict how much needs to be cleared and redrawn.

In this way, drawing can happen in a "render loop" that you manage in some central location that just redraws whatever has been invalidated on each frame, without ever redrawing too much or too often.

Posted on July 27, 2012 at 8:32 AM

Unit Test Support

I am looking at integrating unit testing directly into NME. Out of the box, there is no simple way to use utest or munit with an NMML project, and I think there should be.

For me, munit is the more complex one and it doesn't work out of the box in all cases. It attempts to fire up a neko server on port 2000 that doesn't appear to work. On the bright side, the Massive team that created it is talking about really nice integration with build servers and phantomjs for headless browser testing. Really cool!

Out of the box, the most simple solution appears to be Franco's utest. I was able to get tests up and running with this very quickly.

Long term, we probably want to support both, but what would you the community think if I went ahead and integrated utest just to get things started? This would use a command-line switch to alter the ApplicationMain class you'd ordinarily get with one that imports the utest core and leverages the utest haxelib. Then you could run tests using Runner.addCase/Runner.run, generate reports using Report.create, etc.

I'm surprised there hasn't been discussion of this before, unless I missed it, but it appears most continuous integration/application development type folks are in the haxe community outside of NME.

Awaiting your thoughts!

Cheers,
Patrick

Posted on July 25, 2012 at 1:48 PM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

hahahahaha smiling great to hear, thanks for playing along.

Posted on July 25, 2012 at 12:25 PM

Non-game Applications?

Is anyone working on a Haxe NME application that is not a game? Games are great, and a focus on games is part of the reason NME performs so well, but they generally only require a subset of what the framework can do.

I personally come from the world of e-learning. If you are either looking at or actively using Haxe for a non-game application of any sort, I'd love to hear about it!

Cheers,
Patrick

Posted on July 25, 2012 at 9:59 AM

Re: NMEX

it's not stupid. Native extensions are very powerful! Because they require a bit more programming knowledge about specific targets than the average developer might possess, this sort of thing can be a bit intimidating.

The purpose of native extensions in NME is to allow developers to go beyond "Flash-style" cross-platform programming to leverage platform-specific functionality such as more familiar UI controls, hardware sensors, or high-level subsystems such as Game Center in iOS. Because these things are platform-specific, they might not make sense in NME core but allow for applications to be built in such a way that they are not overtly "cross platform" looking, and potentially a lot more familiar to users.

The last time I looked at NMEX it was a bit out of date but it's a good example to look at for the types of things native extensions can do. As far as Android is concerned, there are at least 3 ways to leverage specific functionality: C++ via the Android NDK, Java via Haxe JNI calls (accessing Java classes via Haxe), and potentially using the new Haxe Java target. For me, the happy medium is to use JNI. My native extensions use a Haxe class as the main interface to whatever application is using it. That Haxe class abstracts differences between iOS, Android, etc. along with potentially even accommodations for Flash and HTML5-specific functionality. Accessing iOS uses CFFI calls to Objective-C++ code with a common C++ header file. When those same calls abstract Android functionality, the Haxe function simply uses compiler conditionals to use JNI to access analogous code in Java classes. In this way, something like calling the native browser view, geolocation, or accessing local storage can be made very simple and easy for the application developer working at a high level.

Does that help?

Patrick

Posted on July 25, 2012 at 9:19 AM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

bitmap data is now copied before draw:http://code.google.com/p/nekonme/source/detail?r=1875...
Your example now works the same in flash, cpp, and html5.

Posted on July 25, 2012 at 9:10 AM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

I see what it's doing. This line: bmd.draw(pixel, tempMtx, new ColorTransform(1, 0.5, 1)); is modifying the original 'pixel' bitmap data so when that is drawn into bmd2, it's been transformed. I am copying the display object texture before the transform but BitmapData is altering its image data. Nice work!

Posted on July 25, 2012 at 8:48 AM

Re: Android Autorotation

Yup, that is how the "landscape" and "portrait" settings in the Android manifest work. The settings you apply to the window tag in your NMML are passed directly to the manifest. In order to implement a custom behavior we'd want to allow for a "nosensor" orientation in the manifest, then handle orientations programmatically in the activity class.

Posted on July 24, 2012 at 8:50 PM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

Alright! back again. Your example behaves identically to Flash with this changeset:http://code.google.com/p/nekonme/source/detail?r=1872...

I also test using a display object as that uses a separate pipeline (happens to be a Sprite with a bitmap fill). Both work even when transformed.

UPDATE:
Be sure to grab the very latest SVN version if you try this. There was a small bug in drawing DisplayObjects when there was no color transform. This is now fixed as of 1874.

Posted on July 24, 2012 at 3:21 PM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

hehe, don't worry I was just kidding around. I have the pipeline modified so the transform is done prior to transforming the resulting image. I need to test it a little bit more but will post back once committed.

cheers,
Patrick

Posted on July 24, 2012 at 1:31 PM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

nevermind, I'm looking at the scaled/rotated problem first.

Posted on July 24, 2012 at 12:07 PM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

now you're just being a troublemaker smiling

anything more you need, just paste in little tests. all of this is new development of features that did not exist before so it will be very helpful to have workable examples of things that work differently in Flash than they do in html5 (or cpp for that matter).

just getting display objects for cpp and html5 to draw to bitmapdata with initial transformation set to identity reduced a significant amount of compiler conditional code in my application, so this is a really constructive process.

thanks,
Patrick

Posted on July 24, 2012 at 12:05 PM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

this sort of thing appears to be behaving as well between flash, cpp, and html5:
bmd.draw(new BitmapData(10, 10, true, 0xff0000ff), mtx, new ColorTransform(0.5, 0.5, 0.5));

Posted on July 24, 2012 at 11:39 AM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

this changeset resolves the issue from your example:
http://code.google.com/p/nekonme/source/detail?r=1871...

Posted on July 24, 2012 at 11:24 AM

Re: bitmapData.draw() doesn't takes matrix and colorTransform parameters into account on html5

awesome, thanks. I'll take a look.

Posted on July 24, 2012 at 11:02 AM