The Daily Click ::. Forums ::. Klik Coding Help ::. Click & Drag Scrolling?
 

Post Reply  Post Oekaki 
 

Posted By Message

Buster

BLING COMMANDER

Registered
  03/06/2002
Points
  1544

VIP Member
26th August, 2012 at 26/08/2012 10:23:22 -

Hello!

Does anyone have any idea how I could make the playfield scroll by clicking and dragging? I'd prefer to do it without using any extensions.

 
http://www.craigeatscrayons.com

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1839

VIP Member
26th August, 2012 at 26/08/2012 10:35:38 -

+ User clicks mouse button
-> Set XClick to XMouse
-> Set YClick to YMouse

+ Repeat while mouse button is down
-> Center display at X: ((X Left Frame+X Right Frame)/2)+(XClick-XMouse)
-> Center display at Y: ((Y Top Frame+Y Bottom Frame)/2)+(YClick-YMouse)

 
n/a

Buster

BLING COMMANDER

Registered
  03/06/2002
Points
  1544

VIP Member
26th August, 2012 at 26/08/2012 11:39:15 -

Thanks Sketchy!

Hmm I just tried this, it works (kind of). I can't quite explain what is actually happening because I'm not sure, it just doesn't respond to the clicking at dragging sometimes.

Do you know what I've done wrong?

Image

 
http://www.craigeatscrayons.com

hapsi



Registered
  13/11/2003
Points
  776
26th August, 2012 at 26/08/2012 15:03:47 -

I would have done it with an active (since i'm "oldschool" and in knp'/tgf those events don't exist), but this a better way.

 
[Signature][/Signature]

hapsi



Registered
  13/11/2003
Points
  776
26th August, 2012 at 26/08/2012 15:05:13 -

Originally Posted by Buster
Thanks Sketchy!

Hmm I just tried this, it works (kind of). I can't quite explain what is actually happening because I'm not sure, it just doesn't respond to the clicking at dragging sometimes.

Do you know what I've done wrong?

Image
Wait.. so does it work or not?

 
[Signature][/Signature]

nivram



Registered
  20/07/2006
Points
  171
26th August, 2012 at 26/08/2012 16:23:19 -

There are a couple of examples on my website.

Marv

 
449 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

hapsi



Registered
  13/11/2003
Points
  776
26th August, 2012 at 26/08/2012 17:00:43 -


Originally Posted by nivram
There are a couple of examples on my website.

Marv



What the fuck dude? I checked your site and i'm impressed. Seriously, where did you found the time and effort? Maybe you have done them for your whole life if you are as old as the man in your avatar ..

 
[Signature][/Signature]

nivram



Registered
  20/07/2006
Points
  171
27th August, 2012 at 27/08/2012 14:37:07 -


Originally Posted by hapsi

Originally Posted by nivram
There are a couple of examples on my website.

Marv



What the fuck dude? I checked your site and i'm impressed. Seriously, where did you found the time and effort? Maybe you have done them for your whole life if you are as old as the man in your avatar ..



Thanks, and the avatar is me. My hair is now twice as long now.

I started in 2008 with the website, but collecting examples since 1999. Hope you find the site useful.

Marv



 
449 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

s-m-r

Slow-Motion Riot

Registered
  04/06/2006
Points
  878

Candle
27th August, 2012 at 27/08/2012 14:48:43 -

Just used an example you had archived on your site this past weekend, Marv.

Thanks for providing such an excellent resource.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
27th August, 2012 at 27/08/2012 17:11:47 -

Marv! You need to upload a new photo right now! Exactly the same as your old one but with your new hair! That would be amazing. You still got that grey top?

 
n/a

Buster

BLING COMMANDER

Registered
  03/06/2002
Points
  1544

VIP Member
27th August, 2012 at 27/08/2012 17:27:04 -

I already had your website in my favourites, Marv! I completely forgot to look there.

Hmm, the same thing is happening when I use the method from the example on your website. I think it might have something to do with how I've set up the frame properties, maybe. This is probably a bit of a newb question, but can someone explain what 'Virtual' Height/Width is?

 
http://www.craigeatscrayons.com

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8234

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
28th August, 2012 at 28/08/2012 02:50:44 -

Virtual Width and Virtual Height are the size of the area that the camera can show at runtime. This can be both bigger or smaller than the frame's actual width and height, and mainly exists so that you can take advantage of "Upon Entering/Exiting the Frame" without scrolling having to stop there (at least that's all I can think of). If you make that value higher than the actual dimensions of the frame, then the camera will be able to show things in that outside area that is usually gray in the frame editor, and if it is smaller, then you will not be able to show all the frame at runtime.

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
28th August, 2012 at 28/08/2012 09:09:45 -

Also, setting either one to -1 will allows scrolling into infinity in that direction. Only right and downwards though. All left and upward scrolling always stops at 0.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
28th August, 2012 at 28/08/2012 11:19:08 -

Also, setting either one to -1 will allows scrolling into infinity in that direction. Only right and downwards though. All left and upward scrolling always stops at 0.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
28th August, 2012 at 28/08/2012 11:45:04 -

Also, setting either one to -1 will allows scrolling into infinity in that direction. Only right and downwards though. All left and upward scrolling always stops at 0.

 
n/a

Buster

BLING COMMANDER

Registered
  03/06/2002
Points
  1544

VIP Member
28th August, 2012 at 28/08/2012 13:20:22 -

Thanks guys. I'm still struggling to get this working, it doesn't matter if I use Sketchy's technique or the method from the tutorial on Marv's website, I get the same results. It's hard to explain what is happening, so I uploaded my test file. If someone could have a look at it for me I would be extremely greatful!

http://www.craigeatscrayons.com/clickscrolling.mfa

 
http://www.craigeatscrayons.com

nivram



Registered
  20/07/2006
Points
  171
28th August, 2012 at 28/08/2012 15:01:11 -

Oh my. Three times. You're on a roll Chris. A little twitchy?

Marv

 
449 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
28th August, 2012 at 28/08/2012 17:09:10 -

I read somewhere that you have to read something 3 times for it to sink in.

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
28th August, 2012 at 28/08/2012 17:10:37 -

But yeah, as twitchy as always. No idea why it posted it 3 times. That seems to happen to me quite regularly. And where is my photo!

 
n/a

nivram



Registered
  20/07/2006
Points
  171
29th August, 2012 at 29/08/2012 03:26:08 -


Originally Posted by Chris Burrows
Marv! You need to upload a new photo right now! Exactly the same as your old one but with your new hair! That would be amazing. You still got that grey top?



If I do that I will be the talk of the village for at least a day.


Does anyone have any idea how I could make the playfield scroll by clicking and dragging? I'd prefer to do it without using any extensions.



My example is set up according to frame size I think.

Marv

 
449 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
29th August, 2012 at 29/08/2012 19:37:59 -

Not to worry, I took one while you were sleeping.

Image


 
n/a

nivram



Registered
  20/07/2006
Points
  171
29th August, 2012 at 29/08/2012 22:55:37 -

Originally Posted by Chris Burrows
Not to worry, I took one while you were sleeping.

Image

That Sir, is exactly how I look now. I shall adapt that.

Marv

 
449 MMF2 & CTF 2.5 examples and games

http://www.castles-of-britain.com/mmf2examples.htm
   

Post Reply



 



Advertisement

Worth A Click