How can I center align the plugin container, based on screen size?
Solved
Center align plugin container
Best answer by tank666
With the recent update to the Plugin API, this is now possible.
Code.js example:
let pluginWidth = 800,
pluginHeight = 480,
centerX = Math.round(figma.viewport.center.x - (pluginWidth / 2)),
centerY = Math.round(figma.viewport.center.y - (pluginHeight / 2));
figma.showUI(
__html__,
{
title: 'Plugin Name',
width: pluginWidth,
height: pluginHeight,
position: {
x: centerX,
y: centerY
}
}
);
This topic has been closed for replies.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.