Difference between CanvasToLayerX / Y and Mouse.X / Mouse.Y

Discussion and feedback on Construct 2

Post » Tue Nov 04, 2014 7:32 pm

I bet you are right on R0J0, that would make sense, if you rotate the frame of reference.

I guess just the specific equations that are doing the translations. From those descriptions they seem like they would be identical, but I do not believe that they are. I am really a Java programmer who got whisked into the JavaScript realm somewhat unwillingly, so I am extremely grateful for Construct. I am just used to documentation that allows me to follow the number trail when it comes to mathematical manipulations. I could take the time to work out an approximation for what is in the black box, but I think that my time is better spent pressing our game development further.

Either way, it works for us for now, so I can't complain too much.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Post » Wed Nov 05, 2014 10:18 am

I'd like to see either an improved or new version of CanvasToLayerX/Y so that it can be used in games that use dynamic displays (such as fullscreen or varying window sizes) because it isn't useful when the canvas changes size/scale. This would be useful for converting coordinates of an object on a layer that scrolls to a HUD layer for instance. Maybe a LayerToLayerX/Y expression.
B
149
S
75
G
20
Posts: 1,791
Reputation: 22,695

Post » Tue Nov 25, 2014 6:32 pm

We have managed to use CanvasToLayerX/Y for our UI layer to resize all of our UI to fit the user's screen. A randomly funny side effect of this block is that it effectively disables the browser's ctrl-mouse-wheel zoom functions, since the UI automatically resizes itself to what we specified.

This method works well beyond my expectations though, which is nice.

Another nice side effect is that you can rearrange your UI based on the user screen's aspect ratio to have a different display for smart phones etc.

1.png
You do not have the required permissions to view the files attached to this post.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,418
Reputation: 4,830

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: AnimH01 and 13 guests