Direction To Edge

I noticed the direction to block does not have an option to select direction to edge, but it has the option to give the distance to the center and mouse pointer. The distance to the edge is certainly reasonable to request in my opinion, because it is needed to build certain functions and blocks relating to the edge of the screen. Maybe it could be added as an extension block.

Well the reason why the "Distance to Edge" block isn't a thing or isn't used is because the edge is NOT an object. It's a parameter.

Well, so isn't the center I'm pretty sure.

The center may not be an object, but it isn't a parameter either.

I think the reason edge is not an option is because every other thing has a single point, say center, that's (0,0). The edge is not a single point, so it's a little harder to implement. Also, there are 4 sides on the edge, so which one would it report?

To slate, that's fair.

To Lego my Ego, I would imagine the closest edge, but where on that edge I don't know.

Maybe Username can give some insight into what they'd use Distance to Edge for.

I feel like it'd only report any multiple of 90 degrees, including 0, like purely 4 directions. You could measure if you're closer to the top than the bottom by comparing your x and y and using the primitive stage size reporters. It'd be easier to make this as a custom block.

Directions to edge are 0, 180 (up. down), -90,90 (left, right).
Distance (shortest line straight to the edge)
Left untitled script pic - 2022-03-01T211756.167
Top untitled script pic - 2022-03-01T211758.504

Off-opic: my username pig latin for lego batman

Me too, but it wouldn't make sense to have something that isn't a single point in the menu. I would rather make a custom block to determine the distance to edge.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.