Equivalent of mouse.x("layer") exp' for objects?

Get help using Construct 2

Post » Fri Jun 22, 2012 7:43 pm

hi

So there's this useful expression: "mouse.x("layer")" which returns the position of the mouse relative to the specified layer, taking into account the layers rotation, scale and parallax scroll.

I was wondering how to recreate this expression, so it can be applied to objects.

Here's a quick cap demonstrating the problem
https://dl.dropbox.com/u/53374990/Rotationproblem/index.html

download link
https://dl.dropbox.com/u/53374990/Rotationproblem/rotationproblem.capx


Thanks for looking, it's been bugging me all day!

also is there a way to delete games off the arcade?
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sun Jul 22, 2012 10:32 am

Bump
B
28
S
8
G
1
Posts: 469
Reputation: 4,683

Post » Sun Jul 22, 2012 2:06 pm

Check out this thread from a few days ago, I think it's the same issue:

Thread Link

I don't think you can delete from the arcade, but you can ask Tom to do it for you.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Sun Jul 22, 2012 8:35 pm

It's similar, but that solution was only for parallax
I need it to take into account the layers Scale and Rotation also

Something that was linked to caught my eye though..
The bottom of this manual entry:
http://www.scirra.com/manual/28/layer
[QUOTE=Manual]Layer functions
layer.canvasToLayerX(x)
layer.canvasToLayerY(y)
Convert from canvas coordinates to layer coordinates. Useful for converting e.g. mouse co-ordinates to layer co-ordinates. See Mouse for an example.
[/QUOTE]
Sounds like it could be the thing that is used for the mouse.x("layer") expression.. Which would be exactly what I need. I just have no idea how to implement this.
B
28
S
8
G
1
Posts: 469
Reputation: 4,683


Return to How do I....?

Who is online

Users browsing this forum: Lof, YoHoho and 20 guests