HUDs and event loop

Oct 8, 2013 at 10:34 PM
I'm looking at HTML5 graphics engine options for an isometric tower defence game. So far sheetengine looks great, but it is quite abstracted from the standard HTML5 Canvas flow. My questions are:

1) Can I get access to the event loop? Or can sheetengine sit alongside a standard Canvas program so that I have direct access to the native Canvas and Context, set my own event loop?

2) How are HUDs and overlays handled? For example; a pop-up overlay which lets you select which kind of tower you want to build?

Thanks in advance.
Coordinator
Oct 9, 2013 at 5:59 AM
Sheetengine does not have an event loop - at least not in the usual game event loop sense. It is just a library that holds reference to your canvas and at a certain point renders stuff on that canvas. There are three possibilities to control the rendering flow:
  • The "stuff" that is rendered is a set of sheets and sheetobjects. Add/remove/manipulate sheets any time, this will have an effect on what is rendered.
  • You call the rendering code at the point where you want to render the scene, place the call to sheetengine.drawing.drawScene() anywhere in your code you want.
  • Even though rendering starts off by clearing the canvas, you will still have access to it and you can render anything on it after sheetengine is done rendering.
So my answers to the questions:

1) Yes, you can access your canvas any time. It is created by you and you only pass it as a reference to sheetengine at the initial phase using sheetengine.scene.init, see examples.

2) I would either implement pop-ups with standard HTML pop-up dialogs with separate divs in the markup, or draw on the canvas after sheetengine rendering is finished, see the example "static drawing", or refer to the corresponding documentation: Static drawing
Oct 9, 2013 at 8:16 PM
Thanks for your quick response. Sounds good, I think sheetengine provides me everything I need. A couple more questions:

1) I noticed there hasn't been any previous activity in this forum since August, are there other places where sheetengine developers can go to discuss problems or get support? E.g. I've mostly been working with the UDK before and I found the help I got on the Epic forums was invaluable; I don't think I would have managed without it.

2) We want to do "traditional" isometric in that all the rotation/angles is handled by using different sprites rather than rotating the sprites as shown in the animation example. I'm guessing this won't be a problem, you can replace/change/animate the sprite of an object on the fly?
Oct 9, 2013 at 9:11 PM
One more question: Can you turn the shadow system off?
Oct 9, 2013 at 11:12 PM
Aaaand another... is it possible to handle height? For example:

http://drag.wootest.net/articles/isometry/dipbump2.PNG
Coordinator
Oct 10, 2013 at 5:44 AM
1) This is probably the best place to come if you have questions. Sheetengine is backed by still a young and growing community, and I haven't noticed any notable community activity on other forums.

2) There is an example of what can be done using sprites here: Animating objects - look for "sprite animation".

3) Shadows can be turned off either on object level (see link at 2)) or globally as described in this article: Adjusting the light source

4) A sheet can have arbitrary width and height set, setting a custom height to a sheet is probably what you would do. Check out "Defining sheets" paragraph in Creating a scene
You could also place sheets on top of each other so that they add up to a larger object.
If you want to place objects on top of sheets/objects in-game, for example if you have a character you would like to move around and make sure this character never "falls down" to the ground if it is placed above a sheet, you may want to check the article about Collision detection

What could be a good general advice, download the examples from the download page and check out every one of them, they pretty much cover everything sheetengine is capable of.
Oct 10, 2013 at 8:21 PM
Thanks for your advice. I know I should have gone and done the tutorials (I only did the first one), my reason for posting questions first was that I didn't want to over-invest time into an engine which might turn out to be inappropriate for our needs... but it looks like everything we need should be possible, so I should go and do the examples myself.