Setting initial plugin:DockWidgetPluginGui() Position

Intro

Creating a DockWidgetPluginGui is very straightforward, currently these are the DockWidgetPluginGuiInfo parameters:

PluginGuiService
DockWidgetPluginGuiInfo.new(
⠀⠀⠀InitialEnabled,
⠀⠀⠀InitialEnabledShouldOverrideRestore,
⠀⠀⠀FloatingXSize,
⠀⠀⠀FloatingYSize,
⠀⠀⠀MinWidth,
⠀⠀⠀MinHeight
)

I’m seeking to change the Position a DockWidgetPluginGui using a plugin script, either by default or while its open, so I can seamlessly move this scripted screen gui window, to a DockWidgetPluginGui.

Issue

There is no reference to FloatingPosition or Position anywhere in the documentation,
and the AbsolutePosition cannot be overwritten. Therefore, the widget-gui ends up initiating somewhere that is not where it should be.

Initial Position (Relative to RobloxStudio)
(40, 40) px

scr

Solutions

AbsolutePosition
⠀⠀⠀I did attempt to change this property, though I got an error as expected:
⠀⠀⠀⠀ can’t set value

There are currently no topics or posts on this topic, though some are slightly related:

PluginGui widget sizing bug

Getting the Mouse position within a PluginGui

How to Detect when Mouse Leaves PluginGui

Feedback

⠀⠀⠀There are no apparent downsides to adding a FloatingPosition parameter to the DockWidgetPluginGuiInfo class: it should accept negatives for the position outside of the Workspace Viewport. moving a DockWidgetPluginGui to point (0,0) (Relative to the Workspace Viewport), or centering it in my opinion would make things seem a lot cleaner.

If there are any hacky ways to do this, please say something!

Recources:

DockWidgetPluginGui

DockWidgetPluginGuiInfo

1 Like

Not sure why this was bumped, but I might as well put my thoughts here.

There is no way (to my knowledge) to set the initial position of a Floating DockWidgetPluginGui. However, you can set the dock area with InitialDockState.

For example, when creating the info object:

local widgetInfo = DockWidgetPluginGuiInfo.new(
	Enum.InitialDockState.Top, -- Will initialize in the top area instead of floating
	true,
	false,
	200,
	300,
	150,
	150
)
1 Like