GraphicalUiElement as IWindow
Introduction
Code Example - Dragging a Window
// Use the isGrabbed value to keep track of whether the user
// grabbed the object.
bool isGrabbed = false;
void CustomInitialize()
{
}
void CustomActivity(bool firstTimeCalled)
{
var cursor = GuiManager.Cursor;
if (isGrabbed)
{
// Assuming there is a component instance in the screen called
// UserControlInstance
this.UserControlInstance.X += cursor.ScreenXChange;
this.UserControlInstance.Y += cursor.ScreenYChange;
}
if (cursor.PrimaryPush && cursor.WindowOver == UserControlInstance)
{
isGrabbed = true;
}
if (cursor.PrimaryClick)
{
isGrabbed = false;
}
}
GuiManager Membership
Last updated
Was this helpful?