Kingsley1997 39 Posted June 21, 2016 I'm creating a map control using ctrlCreate but it's not positioning correctly, at least not visually. The orange box is a static background control with the same position the map control is given. So the position is correct, but the map doesn't work with it :S Source code: https://github.com/marseditor/mars/blob/master/addons/attributes/functions/fnc_ctrlMap.sqf https://github.com/marseditor/mars/blob/master/addons/common/UI/Controls/ctrlMap.hpp Reference images: https://gyazo.com/1761760aa373b896e72a0d5367be22d4 This in particular is interesting. It's technically positioned correctly, but not the image... https://gyazo.com/1e9580f95f7e2d2c06c2cc2c7a512232 Share this post Link to post Share on other sites
Kingsley1997 39 Posted June 21, 2016 Also some more links over here: https://github.com/marseditor/mars/issues/21 Share this post Link to post Share on other sites
moricky 211 Posted June 21, 2016 Could be caused by the fact that maps cannot be in controls groups. Engine treats them a bit differently because of how complex they are. Share this post Link to post Share on other sites
Kingsley1997 39 Posted June 21, 2016 Could be caused by the fact that maps cannot be in controls groups. Engine treats them a bit differently because of how complex they are. Omitting the control group param in ctrlCreate still produces the same problem. Share this post Link to post Share on other sites
moricky 211 Posted June 21, 2016 And since the map is not in controls group, you need to position it in screen coordinates, not in local positions relative to group's left corner. 1 Share this post Link to post Share on other sites
Kingsley1997 39 Posted June 21, 2016 Are there any commands to convert a controls relative position to its group to screen coordinates? Share this post Link to post Share on other sites
Kingsley1997 39 Posted June 21, 2016 I got it working! https://gyazo.com/89c0ad75592f8ee81b8d652839e4e6d7 Share this post Link to post Share on other sites
Kingsley1997 39 Posted June 21, 2016 _position set [0, (_position select 0) + (_controlGroupPos select 0)]; _position set [1, (_position select 1) + (_controlGroupPos select 1)]; _position set [3, (_position select 2)]; _ctrlMap ctrlSetPosition _position; Share this post Link to post Share on other sites
Kingsley1997 39 Posted June 21, 2016 Thanks for the help :D Share this post Link to post Share on other sites
killzone_kid 1332 Posted May 24, 2021 https://community.bistudio.com/wiki/ctrlMapSetPosition rev.147653 1 Share this post Link to post Share on other sites