View Full Version : It's disconcerting to be calling imagecontrol.setViewpointCenter when not in dev doc
SilentRuin
October 8th, 2022, 23:11
It's disconcerting to be calling imagecontrol.setViewpointCenter when not in dev doc - can this be added back in? I see it in the old dev doc but not in https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645070/imagecontrol. I've never been able to figure out the zoom setting given an x,y boundary area but still its something I've successfully called in my extension in FGU for a long while.
SilentRuin
October 9th, 2022, 00:01
Actually reading the imagecontrol.setViewPoint it seems to be what setViewPointCenter used to be. So consider me confused. Should I simply replace my setViewPointCenter with setViewPoint?
Moon Wizard
October 9th, 2022, 00:05
Yes, FGC had two versions of the function that worked slightly differently; FGU uses only setViewpoint and that's what should be used.
Regards,
JPG
SilentRuin
October 9th, 2022, 01:29
How does the zoom value work? I can only ever give it 1.0 or it will go nuts. Is there any way for a button to fit by area when you calculate the high X, low X, high Y, low Y of a group of tokens so I can get map to center on them? I've tried a bunch of experiments with calculating this value based on window and imagecontrol sizes but the only thing I can do is center the image and give it a 1.0. The first time I call imagecontrol.setViewpoint if map is not already up it just brings up the map. Second time (or first if map is already up) the imagecontrol.setViewpoint will then zoom in given 1.0 and then stay there no matter how many times I zoom with 1.0 as it is now 1.0. I need a way to calculate the zoom so it will stop calculating a new zoom level and stick with the correct one based on my token(s) area. Is there a way to calculate this given only window.imagecontrol as input?
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.