nareix Posted February 16, 2016 Share Posted February 16, 2016 WorldPosition(x,y,z) to ScreenPosition(x,y) Link to comment https://forums.kleientertainment.com/forums/topic/64415-is-there-any-functions-transform-worldposition-to-screenposition/ Share on other sites More sharing options...
Mobbstar Posted February 16, 2016 Share Posted February 16, 2016 the closest I know is "input.lua"s screen-to-world method: self.entitiesundermouse = TheSim:GetEntitiesAtScreenPoint(TheSim:GetPosition()) Unfortunately I couldn't find a way to reverse this. And by "reverse this" I mean a similiarly called function. Link to comment https://forums.kleientertainment.com/forums/topic/64415-is-there-any-functions-transform-worldposition-to-screenposition/#findComment-723257 Share on other sites More sharing options...
Arkathorn Posted February 17, 2016 Share Posted February 17, 2016 You can fetch the resolution like this: --Returns the resolution of the game display. Information only valid in fullscreen. function GetResolution() local go = TheFrontEnd:GetGraphicsOptions() --Keep in mind that if you are running this in the special 'modmain.lua'/'modworldgenmain.lua' environment, it must be GLOBAL.TheFrontEnd local id = go:GetFullscreenDisplayID() local mode_id = go:GetCurrentDisplayModeID(id) return go:GetDisplayMode(id, mode_id) end You may be able to derive the screen position based on that and the player's coordinates. Link to comment https://forums.kleientertainment.com/forums/topic/64415-is-there-any-functions-transform-worldposition-to-screenposition/#findComment-723715 Share on other sites More sharing options...
Mobbstar Posted February 17, 2016 Share Posted February 17, 2016 5 hours ago, Arkathorn said: You can fetch the resolution like this: You may be able to derive the screen position based on that and the player's coordinates. You'd need to keep the camera angle in mind. Luckily, "TheCamera" has functions to retrieve its current Vectors. Link to comment https://forums.kleientertainment.com/forums/topic/64415-is-there-any-functions-transform-worldposition-to-screenposition/#findComment-723785 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now