Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by fulvio

I'm using iOSImpact, which is working great.

Except for when I use the following code inside my main.js:

// Calculate health remaining.
ig.system.context.fillStyle = "rgb(105, 3, 7)";
ig.system.context.beginPath();

ig.system.context.rect(meterX, 52, healthMeter, meterHeight);
ig.system.context.closePath();
ig.system.context.fill();

I get the following error(s)

TypeError: 'undefined' is not a function (evaluating 'ig.system.context.beginPath()') at line 324 in lib/game/main.js

Any help would be greatly appreciated as this is an important bit of functionality for my game.

Also if I wanted to only include the following plugin when ig.ua.mobile is true how would I go about that considering it sits inside the requires() block of main.js?

I only want this to be included for mobile:

'plugins.ios.ios'

Thanks in advance.

1 decade ago by Arantor

I don't think iOSImpact supports paths at all.

1 decade ago by amadeus

Arantor is correct. The current implementation of iOSImpact does not support paths.

According to Dominic however, the next version should.

In the meantime, you could use Ludei's CacoonJS, however I find it to not be as performance as iOSImpact.

1 decade ago by fulvio

@alexandre: I tried CocoonJS, got everything working (apart from my player animations looking absolutely ridiculous). Then I learned that there's actually no touch events with Impact yet and gave up.

1 decade ago by Arantor

Um, Impact maps the touch events to the mouse, as the input area describes. It doesn't do multi-touch or gestures, however there is a plugin (including for iOSImpact) for multi-touch.
Page 1 of 1
« first « previous next › last »