Scaleform Mobile SDK for Android multi-touch fix

Source: Internet
Author: User

Fixed scaleform multi-touch (make a note for later people)

Scaleform version number 4.2.24 (estimated that this is the last mobile version, no update)

began to think that Scaleform did not do more touch and gesture. In fact, they are already encapsulated. Only the PC-side emulator is not supported. (Debugging compared to the egg pain can only use the real machine)

But when you use it, you find that Touchevent.begin has a problem. Only the first click Point, and the first lift start, the move operation can be obtained normally.

If you do not modify the code, it can be done by listening to the move to do the operation but always feel uncomfortable. (This one-click is followed by a move action, do not know whether it is a bug, or because the screen is too high PPI reason)

The problem is good. Find the last few lines of the Mainactivity.java file

 for(inti =0; i < P_count; i++){
intaction_id = action% the;//that's the line .if(debug.enabled && Action! =2) {LOG.D ("Gfxplayer","Pointerids:"+" "+Event. Getpointerid (i) +"Action:"+integer.tostring (Action)
+"ID:"+integer.tostring (action_id)); } Nativeontouch (Event. Getpointerid (i), action_id,Event. GetX (i),Event. GetY (i));}


This action value is variable when Android is multi-touch. But it's very regular, (I don't know what Android is, it's not clear why), only one click is action = 0;

When there are two click points will become 261 (256 + 5 + 0), when there are 3 points of Click will become 517 (512 + 5 + 0) and so on. Specific other rules want to grope can print out their own to see.

If you know what you mean, please give me a lot of advice. In fact, should have turned 261 to 0, 517 to 0, but I found him in the Platform_android_gl.cpp file on touchevents[] 5,6,7 also set the Gfx::event::touchbegin, Gfx::event::touchend, gfx::event::touchmove}; This does not have to be turned into 0 1 2, it is also possible to turn into 5,6,7.

You can then use the following code in the AS3.

multitouch.inputmode = multitouchinputmode.touch_point;

Stage.addeventlistener (touchevent.touch_begin,ontouchbegin);

Tail:

Recently in the smooth movement of scaleform, without a clue, a few threads completely look dizzy. Have to know how to solve the request for advice AH.

I myself think that the reason why the Scaleform movement is not smooth is:

1. Each drawframe time is unequal, resulting in the instruction with Enter_frame brush frame (x + speed) is not smooth.

Delta this time difference cannot be obtained directly from the program.

2. Because of the mutual injection between threads, it is not always necessary to draw when the Advance method is executed, resulting in irregular movement of objects.

Scaleform Mobile SDK for Android multi-touch fix

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.