Search found 1 match

by PeterTheHe
Wed Nov 18, 2015 6:59 pm
Forum: Support and Development
Topic: Mouse/Selection system dependent on camera scale/position
Replies: 3
Views: 3498

Re: Mouse/Selection system dependent on camera scale/positio

You'll need to multiply the camera positional vector by camera.scale to get it on the same scale as the map.

Code: Select all

local x = math.floor((mouseX - (camera.x * camera.scale)) / (32 * camera.scale))
local y = math.floor((mouseY - (camera.y * camera.scale)) / (32 * camera.scale))