iioEngine icon indicating copy to clipboard operation
iioEngine copied to clipboard

Can't create shape wirh sprite

Open Reptoh opened this issue 9 years ago • 7 comments

In version 1.4.0 I can't create shape with sprite/image. I research documentation, noted prepGraphics method in older version. Maybe I missed something in new version?

Reptoh avatar May 23 '16 00:05 Reptoh

Is this for a Box2d shape or an iio shape?

sbiermanlytle avatar May 23 '16 01:05 sbiermanlytle

@sbiermanlytle Sorry, box2d shape

Reptoh avatar May 23 '16 14:05 Reptoh

Yes it looks like image attachment isn't working right now in iio 1.4. This will be the next priority but still may take up to a few weeks to get the fix out.

I suggest using iio 1.2 (iioEngine) for this purpose until then. This page has a demo app with Box2d + images: http://iioengine.iioinc.com/demos

you can download the full source code for the engine and the demo here: https://github.com/iioinc/iio.js/tree/v1.2-iioengine

sbiermanlytle avatar May 24 '16 06:05 sbiermanlytle

FYI the Box2d integration and syntax in 1.2 and 1.4 is very similar, so upgrading won't be too bad if you want to do that once the fix is released.

sbiermanlytle avatar May 24 '16 06:05 sbiermanlytle

Thanks for answer! I already got 1.2 with examples. I tried open app on mobile devices: it works fine, but without events.

@sbiermanlytle Do you plan support mobile devices?

Reptoh avatar May 24 '16 08:05 Reptoh

iio doesn't listen for touch events by default, but they can be added easily with EventListeners in the JS standard library, check out these docs for examples: http://iioengine.iioinc.com/docs/iio-basics#input

you can use 'touchstart', 'touchmove', etc to detect mobile input.

And yes, built in mobile feature are going to be the big addition in iio 2.0 - code in JS and deploy straight to iOS, Android, etc

sbiermanlytle avatar May 24 '16 10:05 sbiermanlytle

Great! Thanks for answering!

Reptoh avatar May 24 '16 17:05 Reptoh

@Reptoh please close this issue!

maverickteckh avatar Apr 04 '23 04:04 maverickteckh