sbiermanlytle / iioEngine

iio Engine: A JavaScript game engine for HTML5 Canvas
http://iioengine.com
455 stars 81 forks source link

Can't create shape wirh sprite #42

Closed Reptoh closed 1 year ago

Reptoh commented 8 years ago

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?

sbiermanlytle commented 8 years ago

Is this for a Box2d shape or an iio shape?

Reptoh commented 8 years ago

@sbiermanlytle Sorry, box2d shape

sbiermanlytle commented 8 years ago

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 commented 8 years ago

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.

Reptoh commented 8 years ago

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?

sbiermanlytle commented 8 years ago

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

Reptoh commented 8 years ago

Great! Thanks for answering!

maverickteckh commented 1 year ago

@Reptoh please close this issue!