troubles with mouseX/Y on different layers

For questions about using Classic.

Post » Thu Sep 04, 2008 5:22 pm

I'm not sure how to make a mini-map like in starcraft - and before you mention the mini-map object, what I mean is a map that I can click on, that will cause a layer to scroll to that location. This is probably a really easy question but for some reason I can't come up with a solution.

The reason is that I have the map on a non-scrolling layer and the main window on a scrolling layer, and mouseX/Y always returns the result for the scrolling layer, so mouseX/Y is useless in this case.

I also can't place objects at the mouse location on the non-scrolling hud layer because the x/y is different than the scrolling layer.

Perhaps a parameter like mouseX(layernumber) would help in situations like this? (Though it would be best if it were mouseX(1) when it first appeared, because that's what most people will be using it on, so they wouldn't have to select "layernumber" and edit it every time. Then it would still work as normal, with extra precision if needed.)

Though if there's a way to work around this, that would be great too. :)
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Thu Sep 04, 2008 5:42 pm

[quote:2pi7jdls]Perhaps a parameter like mouseX(layernumber)[/quote:2pi7jdls]
That's already implemented! You can also use MouseX("Layer name")...
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Thu Sep 04, 2008 5:57 pm

Uh... Well then! I guess it was a good suggestion! :D
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Thu Sep 04, 2008 7:14 pm

[quote="Ashley":3vey1i3y]That's already implemented! You can also use MouseX("Layer name")...[/quote:3vey1i3y]

Ashley: Btw, is there already implemented a general position "translation" between layers? I'd like to compare position of an object that is on zoomed and rotated layer, with another object's position but the coordinates are not really comparable because of the zoom and view angle... is there any solution?

Edit: Oh, I noticed just that when layer is rotated, even MouseX("layer") doesn't show the real cordinates. I guess than it's not yet implemented?
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Post » Thu Sep 04, 2008 11:34 pm

[quote="Drasa":1g342u07]Edit: Oh, I noticed just that when layer is rotated, even MouseX("layer") doesn't show the real cordinates. I guess than it's not yet implemented?[/quote:1g342u07]
It should work. What's wrong with it?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Fri Sep 05, 2008 9:08 am

[quote="Ashley":2wgahaw2]
It should work. What's wrong with it?[/quote:2wgahaw2]

I posted a cap demonstrating the bug into the tracker: [url:2wgahaw2]http://sourceforge.net/tracker/download.php?group_id=207820&atid=1003219&file_id=292232&aid=2094635[/url:2wgahaw2]
B
3
S
2
G
5
Posts: 263
Reputation: 2,201


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests