MegaZine3 Version 2 > User Contributions

Engine modifications

(1/1)

vitto32:
Hi,
I've heavily modified in the past the 2.0.10 to add some needed funcionality.
Now I'd like to port all of this modifications to 2.0.11 but it's a huge work and before starting I'd like to know if it's possible to have a few of these modifications included in the next release of Megazine.
There are a few hacks on the core to manage those functionality:

- TouchScreen support
Cursor.as keep hidden mouse and custom cursor. Lec.as clusters mouse Events and "pause"/"restore" them. TooltipFactory.as disables tooltips. Buttons.as works differently to not consider mouse_hover state.

- ScrollPane with scroll offset in pixel and mouse_down continuous scroll (instead of single line scroll with mouse_click).

- no draggable corner while zoom > liquidscale

- single page mode. At the moment I've implemented it as a modified Gallery plugin that appears behind the navigationbar and it's syncronized with pageGoto's

- thumbnails in pageButtons

- buffer customization (buffers all loaded pages) to optimize multiple pages flipping at the same time and keep everything smooth

- audio player and on page play/stop buttons

and few other modifications. You can see an example at http://www.capitello.it/regoledelgioco/italianofacile.html
it's a demo of a website for young students. As for now everything works just fine so my plan to migrate to 2.0.11 it's quite lazy (it's an educational low/no budget project). Also because large part of the work I've done it's hard coded and requires hacks on the megazine engine.

Florian Nücke:
Hi,

damn... wrong key and now the whole post is gone -.-
Alright, again.

First of all, thanks for your efforts in working so deeply in the engine!

There are three categories of the features you listed (for me)
1: the ones I'll gladly add to the engine. E.g. the tooltips, zoom > liquid (both as options via book attributes) and the scrollbar thing (so obvious, totally didn't notice that it doesn't do that :P). Also, how did you realize the audio player? In principle I'd be happy to add that as an option, too.

2: the ones I don't fully understand, but which I might add. Could explain a bit more what you meant with the first two points (mouse cursor and event "pausing"), as well as the "buffer customization"? Thanks!

3: the one that I'd assume is pretty standalone. Your single page mode, which, if it's a plugin, shouldn't make a big fuss when updating (in most cases you won't even have to recompile). I'd imagine some users would be quite happy if you could share it, though :)

Finally, the thumbs in pagebuttons... which don't 100% fit one of the three. Since you can use scripting in v2.0.11, I'd imagine you could do this purely in the .asul file. The only tricky part would be to figure out which page the button belongs to... but essentially that's just the depth of the button in it's container (the nth child it is) times two. If that's too vague let me know and I'll try to implement that later.

vitto32:
first of all, thanks to YOU for your awesome work!

As I told you the modifications I've done are working well but the code it's very ugly in some parts, so right now I'm doing a diff between the 2.0.10 and my code mainly to reorganize ideas and then to understand what can be done trough a plugin, what needs modifications on the engine and what can do through asul scripting (that is the reason that moved me to try porting everything  to 2.0.11+). Obviously I would be glad to share with other users and have some of these integrated in megazine.
And I'd really appreciate any kind of help/suggestions.

I'll try to go a little more in depth. To not write a painfully long post today I can start with the first feature I've listed:

1. Touch Screen support
(in Italy many classes have an Interactive Whiteboard and I wanted to have those books to perform at best in this enviroment)

As you have seen there is a mouse icon to enable/disable mouse support in my modded MegaZine. The original version had the following problems when used on touchscreens:

- The cursor is visible while touchscreen do not need a cursor. That can be solved with 2 static public functions in Cursor.as that enables/disables custom/native cursor to be displayed (it only needs a few line of codes to be added to handleMouseMove and removeCursor in Cursor.as)

- Rollover problems. If the hidden mouse stays over some active elements the hover stays triggered while it shouldn't. Sometimes it's only a graphic problem, but sometimes it compromises functionality (flipping, thumbs, etc..).
So 2 static function in LEC.as are needed to "pause" mouse events (remove the existing mouseEvent listeners and  save them in a "suspended listeners" array, new mouseEvent listener are directly added to that array) and to "restore" (each listener in LEC.suspendedEvents is added back to the related object) when mouse mode is reverted to "mouse on".
Again, this just needs a few line of code to be added to LEC.as.

- Button.as. Buttons workflow in touchscreen do not have STATE_OVER. In my modded version this part is bypassed by an hack but this should be solved in a better way.

- Disable all tooltips. I haven't implemented it yet because removing mouse hover events solves the problem. I only added a static function to hide currently visible tooltipt (the one associated with hide mouse toggle button)

- Remove drag handler to flip ... honestly I can't remember why I've done this.

So when the Hide Mouse toggle button is pressed in my implementation there is a modal "are you sure you want to hide the cursor? Press M to rollback" but it's an optional step. Then these functions are called
    Cursor.hide();
      LEC.removeMouseEvents();
      TooltipFactory.hideActive();
when toggled back:
    Cursor.show();
      LEC.restoreMouseEvents();


I'll try to send you asap the code about this part. I'm sure it would be a lot easier for you to understand the code that my english ;-)

... coming in the next episode: The Player.. 

vitto32:
ok, a first quick question:
I've created the cursor "visible" static property, and I'd like to add a togglebutton in navigationbar.asul with onclick event to interact with Cursor class. Which is the recommended way to do this? I have to add same reference to de.mightypirates.asul.Cursor somewhere i guess.

Navigation

[0] Message Index

Go to full version