playMaker

Author Topic: Touch scroll  (Read 6929 times)

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Touch scroll
« on: August 25, 2012, 10:34:32 AM »
I kind of doing a new app and only want to use playmaker.
The problem I do have right now is that I have a FSM that use GUILayout scroll view.
In the view I have some text, but it is to much to fit the screen, but thats okey.
Right now I can scroll the text if I press the scrollbar and move it. It is also okey.
But if I touch the screen I can not scroll the text.
It would be nice to know how I can make that work.

So how do I do this??

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Touch scroll
« Reply #1 on: August 28, 2012, 11:42:08 PM »
Hi,

 For complex UI, I would recommand that you use ngui or ezgui,

In your case, I am not sure if it's a limitation of unity gui that only accepts one touch at a time or something else.  A quick way to verify this is to have two buttons with two different actions. if you touch and hold one, what happens if you touch the second button?

bye,

 Jean

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Touch scroll
« Reply #2 on: August 31, 2012, 10:49:56 AM »
Hi,

 For complex UI, I would recommand that you use ngui or ezgui,

In your case, I am not sure if it's a limitation of unity gui that only accepts one touch at a time or something else.  A quick way to verify this is to have two buttons with two different actions. if you touch and hold one, what happens if you touch the second button?

bye,

 Jean

I am not sure you did understand what I did mean.
What I was meaning was I want to be able to scroll the "scrollbox" with normal touch and not be forced to use the scrollbar only.
It did work okey on older phone, but with the S3 its kind of hard and not always working.
So I wanted to use normal touch and swipe the screen to scroll the "scrollbox".
Maybe its not that hard. its vector 2 and I guess I only need to read the screen and modified that.
 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Touch scroll
« Reply #3 on: September 03, 2012, 01:47:50 AM »
Hi,

 So you want to control the scrolling programmatically right?

bye,

 Jean

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Touch scroll
« Reply #4 on: September 03, 2012, 04:35:26 AM »
Hi,

 So you want to control the scrolling programmatically right?

bye,

 Jean

Yes.
I want to be able to use the whole screen( scrollbox GUI) to scroll, not just the scrollbar.
Like it is now I can not see how I shall do it with playmaker.
As I can see playmaker do not have anything for vector2, beside the controller that use it.
So you can use a controller that use vector2 (GUI), but you can not change anything.

So the thing I want to do is swipe the screen up/down and send that to the scrollbox so it do scroll the scrollbox, instead of using the scrollbar on the side. it is more normal on a smartphone that you use it like the way I want to do.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Touch scroll
« Reply #5 on: September 03, 2012, 06:42:40 AM »
Hi,

 I am with you now, I will start working on this and make a vector2 package.

http://hutonggames.com/playmakerforum/index.php?topic=2193.0

bye,

 Jean

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Touch scroll
« Reply #6 on: September 04, 2012, 06:27:38 AM »
I did try it out.
It kind of work, but there is still things that need to be done.
As I can not find a way to get the vector2 from the scrollview so I can change that.
Only change to a static value.
What it needs is also to use the vector2 value and add/remove a value to it.
Also a max and min value.

If you can make it like that or some more action to modify the vector 2 value it would be just awesome.


ex.1
Vector2 variable
Vector2 Value
X
Y
Add/Remove to X value  (+ or - value)
Add/Remiove to Y value (+ or -value)
Max X
Min X
Max Y
Min Y
Every Frame


ex.2
From Vector2 variable
X
Y
Add/Remove to X value  (+ or - value)
Add/Remiove to Y value (+ or -value)
Set Vector2 variable
Every Frame

ex.3
From Vector2 variable
Max X
Min X
Max Y
Min Y
Set Vector2 variable
Every Frame

I hope you understand what I mean :-)
« Last Edit: September 04, 2012, 06:31:13 AM by Damian »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Touch scroll
« Reply #7 on: September 05, 2012, 01:59:55 AM »
HI,

 You can get/set the scroll position on the GUILayoutBeginScrollView using the property "scroll Position". Have you tried this?

Also, I would simply maintain a float for the scroll, and then inject this in the scrollPosition vector2.

 I have vector2 actions ticked on my todo's list, so bear with me, it will become available :)

bye,

 Jean

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Touch scroll
« Reply #8 on: September 05, 2012, 03:32:28 AM »
HI,

 You can get/set the scroll position on the GUILayoutBeginScrollView using the property "scroll Position". Have you tried this?

Also, I would simply maintain a float for the scroll, and then inject this in the scrollPosition vector2.

 I have vector2 actions ticked on my todo's list, so bear with me, it will become available :)

bye,

 Jean


Scrollposition is a vector2 value and I still do not see how I can change that when there is no vector2 stuff in playmaker. ;)

How would you do that with a float only?

I will wait for it. I do think it is something that playmaker needs and kind of surprise it still has nothing with vector2. It should be a very basic thing. After all a vector2 is used in many things.
 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Touch scroll
« Reply #9 on: September 06, 2012, 12:50:13 AM »
Hi,

 Working on it, found a bug that I reported to playmaker related to making vector2 actions, so I would expect that the next drop will fix that bug.

bye,

 Jean

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Touch scroll
« Reply #10 on: September 11, 2012, 10:17:11 AM »
Hi,

 Working on it, found a bug that I reported to playmaker related to making vector2 actions, so I would expect that the next drop will fix that bug.

bye,

 Jean

Sounds good  :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Touch scroll
« Reply #11 on: September 27, 2012, 04:46:30 AM »
Hi,

 ok, please find the set of vector2 actions here:

https://hutonggames.fogbugz.com/default.asp?W1004

bye,

 Jean

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Touch scroll
« Reply #12 on: September 27, 2012, 05:00:29 AM »
Hi,

 ok, please find the set of vector2 actions here:

https://hutonggames.fogbugz.com/default.asp?W1004

bye,

 Jean

Man, more work to do today. lol.

Thanks :-)

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Touch scroll
« Reply #13 on: September 27, 2012, 08:43:54 AM »
When I use those I get 3 errors on every action.
Like
"Assets/PlayMaker/Actions/Vector2Add.cs(7,40): error CS0117: `HutongGames.PlayMaker.ActionCategory' does not contain a definition for `Vector2'
"

"Assets/PlayMaker/Actions/Vector2Add.cs(7,10): error CS1502: The best overloaded method match for `HutongGames.PlayMaker.ActionCategoryAttribute.ActionCategoryAttribute(string)' has some invalid arguments"

"Assets/PlayMaker/Actions/Vector2Add.cs(7,10): error CS1503: Argument `#1' cannot convert `object' expression to type `string'
"


EDIT:
I did re-install Playmaker and it do now work. lol
« Last Edit: September 27, 2012, 08:48:05 AM by Damian »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12351
  • Official Playmaker Support
    • View Profile
Re: Touch scroll
« Reply #14 on: September 27, 2012, 11:35:18 AM »
Hi,

 My bad, I was testing with a beta, now it's corrected, please update from the same place:

https://hutonggames.fogbugz.com/default.asp?W1004

sorry for the trouble :)

bye,

 Jean