Heightmapping coordinates don't work with scrolling

For questions about using Classic.

Post » Tue Oct 14, 2008 10:49 pm

I've been trying to get heightmapping lighting to work with the mouse position, and the coordinates when the screen is at the top left are about mousex*0.00155 and mousey*0.002. It works until I scroll the screen, then the lighting gets misaligned again.

Is there anything that can be done about this?
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Tue Oct 14, 2008 10:52 pm

You could probably add the amount of X/Y scrolling to the X/Y coordinates of the light. It should probably work.
Moderator
B
97
S
36
G
19
Posts: 1,584
Reputation: 17,692

Post » Tue Oct 14, 2008 11:00 pm

Try (MouseX - ScrollXLeft) * 0.00155 and (MouseY - ScrollYTop) * 0.002.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Tue Oct 14, 2008 11:05 pm

Thanks, it works great! :D A lot cleaner than the (mousex*0.00155)-(scrollx*0.00155)+0.5 I started trying to use. :)
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Tue Oct 14, 2008 11:08 pm

Another question - where's the way to set the attributes to effects applied to a layer via an action at runtime?

Sorry if it's obvious and I can't find it...
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Tue Oct 14, 2008 11:40 pm

Sorry, it's not yet implemented... on the todo list!
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests