本文整理汇总了C#中WindowBase.WindowToScreen方法的典型用法代码示例。如果您正苦于以下问题:C# WindowBase.WindowToScreen方法的具体用法?C# WindowBase.WindowToScreen怎么用?C# WindowBase.WindowToScreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowBase
的用法示例。
在下文中一共展示了WindowBase.WindowToScreen方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateSimTooltip
private static Tooltip CreateSimTooltip(Vector2 mousePosition, WindowBase parent, ref Vector2 tooltipPosition)
{
try
{
if (Sims3.Gameplay.UI.Responder.Instance == null) return null;
IHudModel hudModel = Sims3.Gameplay.UI.Responder.Instance.HudModel;
if (hudModel == null) return null;
SimInfo tag = parent.Tag as SimInfo;
if (PortraitPanel.Settings.mShowKnownInfo)
{
SimDescription sim = PortraitPanel.Settings.GetSim(tag);
if ((sim != null) && (Sim.ActiveActor != null))
{
Tooltip result = new KnownInfoTooltip(sim.FullName, hudModel.GetLTRRelationshipString(Sim.ActiveActor.SimDescription, sim), sim.HomeWorld, HudModelEx.GetKnownInfo(hudModel as HudModel, sim));
tooltipPosition.x = parent.WindowToScreen(new Vector2(0,0)).x + parent.Area.Width;
Window firstPortrait = Skewer.Instance.GetChildByID(0xf6fda571, true) as Window;
tooltipPosition.y = firstPortrait.WindowToScreen(new Vector2(0, 0)).y - result.TooltipWindow.Area.Height;
return result;
}
else
{
return null;
}
}
float offsetX = -5f;
float offsetY = -10f;
if (GameUtils.IsInstalled(ProductVersion.EP9))
{
int nerdLevel = -1;
int rebelLevel = -1;
int socialiteLevel = -1;
hudModel.GetCurrentSimInfluence(tag, ref nerdLevel, ref rebelLevel, ref socialiteLevel);
return InfluentialCelebrityTooltip.CreateTooltipWithOffset(parent, ref tooltipPosition, tag, nerdLevel, rebelLevel, socialiteLevel, offsetX, offsetY);
}
return CelebrityTooltip.CreateTooltipWithOffset(parent, ref tooltipPosition, tag, offsetX, offsetY);
}
catch (Exception e)
{
Common.Exception("CreateKnownInfoToolTip", e);
}
return null;
}
示例2: OnLayerMouseMove
private void OnLayerMouseMove(WindowBase sender, UIMouseEventArgs eventArgs)
{
if ((this.mMouseClickPos != this.kInvalidMousePos) && (this.mClickedWin != null))
{
Vector2 vector = sender.WindowToScreen(eventArgs.MousePosition) - this.mMouseClickPos;
if (vector.LengthSqr() > 50f)
{
this.StartDrag();
}
}
}
示例3: OnMaterialsSkewerGridMouseDown
public static void OnMaterialsSkewerGridMouseDown(WindowBase sender, UIMouseEventArgs eventArgs)
{
Common.StringBuilder msg = new Common.StringBuilder("OnMaterialsSkewerGridMouseDown");
try
{
CASCompositorController ths = CASCompositorController.sController;
if (ths == null) return;
if ((ths.mCurrentDesignObject == null) || (ths.mMaterialSkewerSelectedPattern == -1))
{
msg += "A";
if (sender.Enabled)
{
eventArgs.Handled = true;
}
}
else if (ths.mCurrentDesignObject.Processing)
{
msg += "B";
ths.mMaterialToSelect = ((int)sender.ID) - 0x1300a;
Audio.StartSound("ui_tertiary_button");
if (sender.Enabled)
{
eventArgs.Handled = true;
}
}
else if ((sender as Button).Enabled)
{
msg += "C";
ths.mClickedWin = sender;
ths.mMouseClickPos = sender.WindowToScreen(eventArgs.MousePosition);
// Must be after mClickedWin is set above
int selection = ((int)ths.mClickedWin.ID) - 0x1300a;
bool selected = (selection == ths.MaterialSkewerSelectedPattern);
ths.MaterialSelect(selection, true);
if (eventArgs.MouseKey == MouseKeys.kMouseLeft)
{
msg += "D";
ths.mPickupScript = Simulator.AddObject(new Sims3.Gameplay.OneShotFunctionTask(ths.StartMaterialDrag, StopWatch.TickStyles.Seconds, CASCompositorController.kPickupDelay));
UIManager.SetCaptureTarget(InputContext.kICMouse, sender);
if ((eventArgs.Modifiers & (Modifiers.kModifierMaskShift | Modifiers.kModifierMaskControl)) != Modifiers.kModifierMaskNone)
{
Common.FunctionTask.Perform(OnProcessRandomizeColor);
}
}
else if (eventArgs.MouseKey == MouseKeys.kMouseRight)
{
msg += "E";
if ((selected) && ((eventArgs.Modifiers & (Modifiers.kModifierMaskShift | Modifiers.kModifierMaskControl)) != Modifiers.kModifierMaskNone))
{
Common.FunctionTask.Perform(OnProcessRandomizeCategory);
}
else
{
Common.FunctionTask.Perform(OnProcessRandomizeMaterial);
}
}
msg += "E";
eventArgs.Handled = true;
}
}
catch (Exception e)
{
Common.Exception(msg, e);
}
}
示例4: OnLayerMouseDown
private void OnLayerMouseDown(WindowBase sender, UIMouseEventArgs eventArgs)
{
if (eventArgs.MouseKey == MouseKeys.kMouseLeft)
{
this.mClickedWin = sender;
this.mMouseClickPos = sender.WindowToScreen(eventArgs.MousePosition);
this.ActiveLayer = ((int) sender.ID) - 0x92fa021;
this.mPickupScript = Simulator.AddObject(new OneShotFunctionTask(new Function(this.StartDrag), StopWatch.TickStyles.Seconds, kPickupDelay));
UIManager.SetCaptureTarget(InputContext.kICMouse, sender);
eventArgs.Handled = true;
}
}