本文整理汇总了C#中AGS.Editor.RoomEditorState类的典型用法代码示例。如果您正苦于以下问题:C# RoomEditorState类的具体用法?C# RoomEditorState怎么用?C# RoomEditorState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RoomEditorState类属于AGS.Editor命名空间,在下文中一共展示了RoomEditorState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MouseMove
public override bool MouseMove(int x, int y, RoomEditorState state)
{
if (_draggingBaseline)
{
int newBaseline = (y + state.ScrollOffsetY) / state.ScaleFactor;
if (newBaseline < 0)
{
newBaseline = 0;
}
if (newBaseline >= _room.Height)
{
newBaseline = _room.Height - 1;
}
_room.WalkBehinds[_selectedArea].Baseline = newBaseline;
_room.Modified = true;
state.CurrentCursor = Cursors.HSplit;
return true;
}
if (base.MouseMove(x, y, state))
{
return true;
}
if (IsCursorOnHorizontalEdge(y, GetCurrentAreaBaselineScreenY(state), state))
{
state.CurrentCursor = Cursors.HSplit;
}
return false;
}
开发者ID:smarinel,项目名称:ags-web,代码行数:31,代码来源:WalkBehindsEditorFilter.cs
示例2: MouseUp
public void MouseUp(MouseEventArgs e, RoomEditorState state)
{
if (e.Button == MouseButtons.Middle)
{
ShowCoordMenu(e, state);
}
}
开发者ID:Aquilon96,项目名称:ags,代码行数:7,代码来源:EmptyEditorFilter.cs
示例3: SelectCharacter
private void SelectCharacter(AgsView view, Character character, int xClick, int yClick, RoomEditorState state)
{
int spriteNum = 0;
if (view.Loops[0].Frames.Count > 0)
{
ViewFrame thisFrame = view.Loops[0].Frames[0];
spriteNum = thisFrame.Image;
}
int width = GetSpriteWidthForGameResolution(spriteNum);
int height = GetSpriteHeightForGameResolution(spriteNum);
if ((xClick >= character.StartX - (width / 2)) && (xClick < character.StartX + (width / 2)) &&
(yClick >= character.StartY - height) && (yClick < character.StartY))
{
if (!state.DragFromCenter)
{
_mouseOffsetX = xClick - character.StartX;
_mouseOffsetY = yClick - character.StartY;
}
else
{
_mouseOffsetX = 0;
_mouseOffsetY = 0;
}
_selectedCharacter = character;
_movingCharacterWithMouse = true;
}
}
开发者ID:Aquilon96,项目名称:ags,代码行数:30,代码来源:CharactersEditorFilter.cs
示例4: MouseDown
public void MouseDown(MouseEventArgs e, RoomEditorState state)
{
int xClick = (e.X + state.ScrollOffsetX) / state.ScaleFactor;
int yClick = (e.Y + state.ScrollOffsetY) / state.ScaleFactor;
_selectedCharacter = null;
foreach (Character character in _game.RootCharacterFolder.AllItemsFlat)
{
if (_room.Number == character.StartingRoom)
{
AgsView view = _game.FindViewByID(character.NormalView);
if (view != null && view.Loops.Count > 0)
{
SelectCharacter(view, character, xClick, yClick, state);
}
}
}
if (_selectedCharacter != null)
{
Factory.GUIController.SetPropertyGridObject(_selectedCharacter);
}
else
{
Factory.GUIController.SetPropertyGridObject(_room);
}
}
开发者ID:Aquilon96,项目名称:ags,代码行数:29,代码来源:CharactersEditorFilter.cs
示例5: PaintToHDC
public virtual void PaintToHDC(IntPtr hDC, RoomEditorState state)
{
_objectBaselines.Clear();
foreach (RoomObject obj in _room.Objects)
{
if (obj.Baseline <= 0)
{
obj.EffectiveBaseline = obj.StartY;
}
else
{
obj.EffectiveBaseline = obj.Baseline;
}
_objectBaselines.Add(obj);
}
_objectBaselines.Sort();
foreach (RoomObject obj in _objectBaselines)
{
int height = GetSpriteHeightForGameResolution(obj.Image);
int ypos = AdjustYCoordinateForWindowScroll(obj.StartY, state) - (height * state.ScaleFactor);
Factory.NativeProxy.DrawSpriteToBuffer(obj.Image, AdjustXCoordinateForWindowScroll(obj.StartX, state), ypos, state.ScaleFactor);
}
}
开发者ID:Aquilon96,项目名称:ags,代码行数:25,代码来源:ObjectsEditorFilter.cs
示例6: Paint
public void Paint(Graphics graphics, RoomEditorState state)
{
int scaleFactor = state.ScaleFactor;
DrawDoubleWidthVerticalLine(graphics, _room.LeftEdgeX * scaleFactor - state.ScrollOffsetX, scaleFactor);
DrawDoubleWidthVerticalLine(graphics, _room.RightEdgeX * scaleFactor - state.ScrollOffsetX, scaleFactor);
DrawDoubleHeightHorizontalLine(graphics, _room.TopEdgeY * scaleFactor - state.ScrollOffsetY, scaleFactor);
DrawDoubleHeightHorizontalLine(graphics, _room.BottomEdgeY * scaleFactor - state.ScrollOffsetY, scaleFactor);
}
开发者ID:Aquilon96,项目名称:ags,代码行数:8,代码来源:EdgesEditorFilter.cs
示例7: DoubleClick
public void DoubleClick(RoomEditorState state)
{
if (_lastSelectedObject != null)
{
Sprite chosenSprite = SpriteChooser.ShowSpriteChooser(_lastSelectedObject.Image);
if (chosenSprite != null)
{
_lastSelectedObject.Image = chosenSprite.Number;
}
}
}
开发者ID:srirangav,项目名称:ags-geminirue,代码行数:11,代码来源:ObjectsEditorFilter.cs
示例8: MouseDown
public override void MouseDown(MouseEventArgs e, RoomEditorState state)
{
if (IsCursorOnHorizontalEdge(e.Y, GetCurrentAreaBaselineScreenY(state), state))
{
_draggingBaseline = true;
}
else
{
base.MouseDown(e, state);
}
}
开发者ID:smarinel,项目名称:ags-web,代码行数:11,代码来源:WalkBehindsEditorFilter.cs
示例9: Paint
public override void Paint(Graphics graphics, RoomEditorState state)
{
int lineYPos = GetCurrentAreaBaselineScreenY(state);
Pen pen = (Pen)GetPenForArea(_selectedArea).Clone();
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
for (int i = 0; i < state.ScaleFactor; i++)
{
graphics.DrawLine(pen, 0, lineYPos + i, graphics.VisibleClipBounds.Right, lineYPos + i);
}
base.Paint(graphics, state);
}
开发者ID:Aquilon96,项目名称:ags,代码行数:13,代码来源:WalkBehindsEditorFilter.cs
示例10: Paint
public override void Paint(Graphics graphics, RoomEditorState state)
{
base.Paint(graphics, state);
foreach (RoomHotspot hotspot in _room.Hotspots)
{
if ((hotspot.WalkToPoint.X > 0) && (hotspot.WalkToPoint.Y > 0))
{
int x = (hotspot.WalkToPoint.X * state.ScaleFactor) - state.ScrollOffsetX;
int y = (hotspot.WalkToPoint.Y * state.ScaleFactor) - state.ScrollOffsetY;
graphics.DrawLine(Pens.Red, x - 4, y - 4, x + 4, y + 4);
graphics.DrawLine(Pens.RosyBrown, x - 4, y + 4, x + 4, y - 4);
graphics.DrawString(hotspot.ID.ToString(), new System.Drawing.Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold), Brushes.Gold, x + 4, y - 7);
}
}
}
开发者ID:Aquilon96,项目名称:ags,代码行数:16,代码来源:HotspotsEditorFilter.cs
示例11: MouseUp
public override void MouseUp(MouseEventArgs e, RoomEditorState state)
{
if (_draggingBaseline)
{
_draggingBaseline = false;
}
else
{
base.MouseUp(e, state);
if ((_room.WalkBehinds[_selectedArea].Baseline < 1) &&
(!_shownTooltip))
{
_tooltip.Show("After painting the area, remember to set its baseline by dragging the line down from the top of the background.", _panel, e.X, e.Y - 70, 5000);
_shownTooltip = true;
}
}
}
开发者ID:smarinel,项目名称:ags-web,代码行数:18,代码来源:WalkBehindsEditorFilter.cs
示例12: ShowCoordMenu
private void ShowCoordMenu(MouseEventArgs e, RoomEditorState state)
{
EventHandler onClick = new EventHandler(CoordMenuEventHandler);
ContextMenuStrip menu = new ContextMenuStrip();
menu.Items.Add(new ToolStripMenuItem("Copy mouse coordinates to clipboard", null, onClick, MENU_ITEM_COPY_COORDS));
_menuClickX = (e.X + state.ScrollOffsetX) / state.ScaleFactor;
_menuClickY = (e.Y + state.ScrollOffsetY) / state.ScaleFactor;
if ((Factory.AGSEditor.CurrentGame.Settings.UseLowResCoordinatesInScript) &&
(_room.Resolution == RoomResolution.HighRes))
{
_menuClickX /= 2;
_menuClickY /= 2;
}
menu.Show(_panel, e.X, e.Y);
}
开发者ID:Aquilon96,项目名称:ags,代码行数:18,代码来源:EmptyEditorFilter.cs
示例13: AdjustYCoordinateForWindowScroll
private int AdjustYCoordinateForWindowScroll(int y, RoomEditorState state)
{
return (y - (state.ScrollOffsetY / state.ScaleFactor)) * state.ScaleFactor;
}
开发者ID:srirangav,项目名称:ags-geminirue,代码行数:4,代码来源:ObjectsEditorFilter.cs
示例14: AdjustXCoordinateForWindowScroll
private int AdjustXCoordinateForWindowScroll(int x, RoomEditorState state)
{
return (x - (state.ScrollOffsetX / state.ScaleFactor)) * state.ScaleFactor;
}
开发者ID:srirangav,项目名称:ags-geminirue,代码行数:4,代码来源:ObjectsEditorFilter.cs
示例15: Paint
public virtual void Paint(Graphics graphics, RoomEditorState state)
{
if (_selectedObject != null)
{
int width = GetSpriteWidthForGameResolution(_selectedObject.Image);
int height = GetSpriteHeightForGameResolution(_selectedObject.Image);
int xPos = AdjustXCoordinateForWindowScroll(_selectedObject.StartX, state);
int yPos = AdjustYCoordinateForWindowScroll(_selectedObject.StartY, state) - (height * state.ScaleFactor);
Pen pen = new Pen(Color.Goldenrod);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
graphics.DrawRectangle(pen, xPos, yPos, width * state.ScaleFactor, height * state.ScaleFactor);
if (_movingObjectWithMouse)
{
System.Drawing.Font font = new System.Drawing.Font("Arial", 10.0f);
string toDraw = String.Format("X:{0}, Y:{1}", _selectedObject.StartX, _selectedObject.StartY);
int scaledx = xPos + (width * state.ScaleFactor / 2) - ((int)graphics.MeasureString(toDraw, font).Width / 2);
int scaledy = yPos - (int)graphics.MeasureString(toDraw, font).Height;
if (scaledx < 0) scaledx = 0;
if (scaledy < 0) scaledy = 0;
graphics.DrawString(toDraw, font, pen.Brush, (float)scaledx, (float)scaledy);
}
}
}
开发者ID:srirangav,项目名称:ags-geminirue,代码行数:26,代码来源:ObjectsEditorFilter.cs
示例16: MouseUp
public virtual void MouseUp(MouseEventArgs e, RoomEditorState state)
{
_movingObjectWithMouse = false;
_lastSelectedObject = _selectedObject;
if (e.Button == MouseButtons.Middle)
{
ShowCoordMenu(e, state);
}
}
开发者ID:srirangav,项目名称:ags-geminirue,代码行数:10,代码来源:ObjectsEditorFilter.cs
示例17: MouseMove
public virtual bool MouseMove(int x, int y, RoomEditorState state)
{
if (!_movingObjectWithMouse) return false;
int realX = (x + state.ScrollOffsetX) / state.ScaleFactor;
int realY = (y + state.ScrollOffsetY) / state.ScaleFactor;
if ((_movingObjectWithMouse) && (realY < _room.Height) &&
(realX < _room.Width) && (realY >= 0) && (realX >= 0))
{
int newX = realX - _mouseOffsetX;
int newY = realY - _mouseOffsetY;
return MoveObject(newX, newY);
}
return false;
}
开发者ID:srirangav,项目名称:ags-geminirue,代码行数:15,代码来源:ObjectsEditorFilter.cs
示例18: MouseDown
public void MouseDown(MouseEventArgs e, RoomEditorState state)
{
}
开发者ID:Aquilon96,项目名称:ags,代码行数:3,代码来源:EmptyEditorFilter.cs
示例19: PaintToHDC
public void PaintToHDC(IntPtr hDC, RoomEditorState state)
{
}
开发者ID:smarinel,项目名称:ags-web,代码行数:3,代码来源:EdgesEditorFilter.cs
示例20: MouseUp
public void MouseUp(MouseEventArgs e, RoomEditorState state)
{
_selectedEdge = SelectedEdge.None;
}
开发者ID:smarinel,项目名称:ags-web,代码行数:4,代码来源:EdgesEditorFilter.cs
注:本文中的AGS.Editor.RoomEditorState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论