Real slide screen behavior for mobiles?

Neotron

  • Posts: 475
Is there any chance to create a simple real sliding stage selection screen with Stencyl?
I tired many times, many ways, asked many people to help to create one but noone had real success...

LIBERADO

  • *
  • Posts: 2660
Can you post a link to a YouTube video which shows that kind of sliding stage selection screen in any game?
I'm spanish, excuse me for my bad English.
I'm not a private teacher. Please, post your questions in the public forum.

mat0pad

  • Posts: 364
Is there any chance to create a simple real sliding stage selection screen with Stencyl?
I tired many times, many ways, asked many people to help to create one but noone had real success...


I've made one. But it's not very customizable. It works just like the home screen. It has:  flick enabled, slower ends and same constant speed. However I've made it into four swipeable pages. If you want four pages or two, you can use it. Otherwise you will need to configure it yourself (it's hard to do the math behind it for all screen sizes, and also I've not documented it. I can help with guidance)

I can upload a sample project for you to test and if it's what you are looking for I can upload it. I'll do that when I get home after work ;)

EDIT:

Here is the demo:
http://www.stencyl.com/game/play/29263

(Keep in mind this demo displays what I wanted which was 4 pages not more. More can be made but it will then need more calculations)

« Last Edit: December 26, 2014, 09:12:04 am by mat0pad »
   


                              

Neotron

  • Posts: 475
That would be great mat0pad! :) I got one which is working with flash (with mouse) but somehow not working with touchscreen.
Btw, Liberado here is a video about sliding stage selection screen:
https://www.youtube.com/watch?v=5SEhrRZmYdQ
It is from the first Cut the Rope game.

mat0pad

  • Posts: 364
It will of course only work on mobiles if publish to them ;)


I'll post the behavior and steps necessary by sometime tomorrow. Also I'll try to document it better.

EDIT:

Just to show why it will take some time to document ;)

---------SEE ATTACHMENTS----------

- snippet1 controls how to first actor moves.

- snippet2 handels the interaction with all buttons (however it's disabled in the version I uploaded)

-snippet3 handels all the other actors, and makes them follow the first actor (meaning level 1).



« Last Edit: December 26, 2014, 10:07:03 am by mat0pad »
   


                              

Neotron

  • Posts: 475
It looks great mat0pad! The best I saw till then. Can you upload to StencylForge, please? It would be a great source! :-)
I bet it is hard to customize, there should be some factors to create new one (screen size, landscape or portrait).
Actually I need 8-10 screens to swipe, so somehow I try to customize if I can.

P.s.: Wow, I checked the screenshots you attached with the blocks...well, it looks like a pretty complex code. I will try to customize it, but not looks easy..:P

« Last Edit: December 26, 2014, 10:41:38 am by Neotron »

Neotron

  • Posts: 475
Well, I confused a bit. Waiting for the behavior and the some description help. Thank you! :)

mat0pad

  • Posts: 364
Had alot of work to do so have not been able to send it before now. Here it is.


Attach it to actor that you want to be swipeable. Make your other actors follow the swipeable actor and that's pretty much it ;)




« Last Edit: April 26, 2015, 02:40:14 pm by mat0pad »
   


                              

Neotron

  • Posts: 475
Thank you! Now I got to work it, so actors can slide. But the problem is if I touch on one of them cannot change scene.
Where I should add scene switch code?
If I add to the actor it will always change scene if the actor touched (for example for swipe).
It would be good to switch scene only if actors swipe is stopped.

mat0pad

  • Posts: 364
Here you need to add some code that checks where the actor is. If it's not at the initial position (keep in mind the other views) then it cant be pressed
   


                              

Neotron

  • Posts: 475
This is the main problem, because if I touch the screen the "initial position" move a bit(just few pixels)and I don't know when swipe and when stopped the actor.
Do you have any idea how to check actor position and how to switch scene if touched?

Neotron

  • Posts: 475
Well, at last I solved the switch scene problem.
I attached the shot which has to be add to the stage scene.
And I attached a slightly modified swipe behavior. You have to add to all stages actor as many you have (So if you have 5 stage actors you have to duplicate the behavior 5 times then add to them one by one).
Then you have to change the "set initial pos x of actor to XXXX". XXXX the number x coordinates of stage actors on the scene.
That's all! That is the "easiest" way to making swipe selector with Stencyl.

Mat0pad you did a great code, I was not able to create a swipe scene without you. Thank youu! :)

mat0pad

  • Posts: 364
This will not work for mutilpe pages. You are not taking the other views into consideration. The correct way would be as in the post earlier attachment called "snippet2". However you would need to set the global att from the swipe behavior (not done in the uploaded version.


Edit: please see snippet 2 for the correct button catch method


« Last Edit: April 26, 2015, 02:39:43 pm by mat0pad »