123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|36|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Mouse coords in a larger than screen world?

Fri, 19 Oct 2007, 14:37
spinal
I have taken the string code from the showcase and am attempting to get it working on a scrolling background.
So far, I have managed to get the string to appear in the correct position on the background, but I am having trouble getting the mouse location from the perspective of the background, rather than the screen.



-=-=-
Check out my excellent homepage!
Fri, 19 Oct 2007, 16:03
Forklift_Fred
Er... you've lost me ever so slightly.
I don't mean to be rude but what are you trying to do?

I'm guessing it's to do with the blue dot/square? Where is it supposed to be? At the moment it's half way between the string and the mouse but I've not dug deep enough to understand why that is.

-=-=-
Come rain or shine...
Fri, 19 Oct 2007, 16:28
spinal
the blue square should float towards the mouse pointer, and should also be at the end of the string. If you move to the top left of the screen, where the background image does not scroll, see how it acts? I am trying to get that, but on a scrolling background.

-=-=-
Check out my excellent homepage!
Fri, 19 Oct 2007, 16:47
Forklift_Fred
OK, I see it. I take it you need it to relate to background otherwise you could just use the normal MouseX() and MouseY()

I'll have to drill right into the workings but it's got to be a maths problem so I should get there...

-=-=-
Come rain or shine...
Fri, 19 Oct 2007, 16:59
spinal
Thanks Fred. I've tried loads of things, but couldn't get it.

In short for anyone else who wants to try, I want to find the mouse coords relative to the background image, not relative to the screen/window.

-=-=-
Check out my excellent homepage!
Fri, 19 Oct 2007, 19:23
Forklift_Fred
Sorry Spinal I seem to have tied myself in knots.

I think I've ended up defeating the object!

It should be a simple displacement but I think you might need a separate variable to offset after your calculations. Calculate your new position to chase the pointer, then offset it for the scroll.

I'll take another look tomorrow but I have to go to work so it won't be until the evening.

-=-=-
Come rain or shine...
Sat, 20 Oct 2007, 06:06
GoliX
I've had a mess about and managed to get it all to scroll ok, the problem is as it scrolls the tail flicks ahead of the mouse, so it's flowing backwards. I'll keep trying but this is what I have so far(bit butchered).


Sat, 20 Oct 2007, 07:17
spinal
It seems that the background is scrolling differently from the string, I need the string to be placed correctly on the background.

-=-=-
Check out my excellent homepage!
Sat, 20 Oct 2007, 13:18
Forklift_Fred
If you take out the scroll variables from this part of the move_tail() function



The string sticks to the background and node 0 chases the pointer... I don't understand why node 1 doesn't follow it though, since each node's position is based on the previous...

-=-=-
Come rain or shine...
Sat, 20 Oct 2007, 14:25
spinal
if your talking about the blue(ish) squre, its not rendered with the scroll data, but on screen instead.

I have noticed that the offset between the mouse pointer and the first point is the same as the scroll distance.

-=-=-
Check out my excellent homepage!
Sat, 20 Oct 2007, 17:30
spinal
this seems to work, although is a million times too fast. Any adeas?


-=-=-
Check out my excellent homepage!
Sun, 21 Oct 2007, 04:29
Jayenkai


But it does mess up when you hit the edge.. Perhaps remove the Edge code..?

-=-=-
''Load, Next List!''