public void DefaultColors() { backgroundColor = new Drawer.Color(0.33, 0.33, 0.33); pointColor = new Drawer.Color(1, 0, 0); annotationColor = new Drawer.Color(0, 0, 1); impassableLineColor = new Drawer.Color(0.2, 0.98, 0.48); solidLineColor = new Drawer.Color(0, 0, 0); transparentLineColor = new Drawer.Color(0.2, 0.8, 0.8); selectedLineColor = new Drawer.Color(1, 1, 0); selectedPolygonColor = new Drawer.Color((double)0xff / 0xff, (double)0xcc / 0xff, (double)0x66 / 0xff); destinationPolygonColor = new Drawer.Color((double)0x99 / 0xff, (double)0xbb / 0xff, (double)0x55 / 0xff); polygonColor = new Drawer.Color(0.87, 0.87, 0.87); invalidPolygonColor = new Drawer.Color((double)0xfb / 0xff, (double)0x48 / 0xff, (double)0x09 / 0xff); gridLineColor = new Drawer.Color(0.6, 0.6, 0.6); gridPointColor = new Drawer.Color(0, 0.8, 0.8); objectColor = new Drawer.Color(1, 1, 0); playerColor = new Drawer.Color(1, 1, 0); monsterColor = new Drawer.Color(1, 0, 0); civilianColor = new Drawer.Color(0, 0, 1); }
void DrawLine(Line line) { Point p1 = Level.Endpoints[line.EndpointIndexes[0]]; Point p2 = Level.Endpoints[line.EndpointIndexes[1]]; Drawer.Color color = solidLineColor; if (Selection.Line != -1 && line == Level.Lines[Selection.Line]) { color = selectedLineColor; } else if (line.Transparent) { color = transparentLineColor; } else if (line.Solid && line.ClockwisePolygonOwner != -1 && line.CounterclockwisePolygonOwner != -1) { Polygon poly1 = Level.Polygons[line.ClockwisePolygonOwner]; Polygon poly2 = Level.Polygons[line.CounterclockwisePolygonOwner]; if (poly1.FloorHeight != poly2.FloorHeight) { color = impassableLineColor; } } drawer.DrawLine(color, Transform.ToScreenPoint(p1), Transform.ToScreenPoint(p2)); }
void DrawFatPoint(Drawer.Color color, Point point) { const int r = 2; List <Drawer.Point> points = new List <Drawer.Point>(); double X = Transform.ToScreenX(point.X); double Y = Transform.ToScreenY(point.Y); points.Add(new Drawer.Point(X - r, Y - r)); points.Add(new Drawer.Point(X + r, Y - r)); points.Add(new Drawer.Point(X + r, Y + r)); points.Add(new Drawer.Point(X - r, Y + r)); drawer.FillStrokePolygon(color, new Drawer.Color(0, 0, 0), points, false); }
void DrawTriangle(Drawer.Color c, double X, double Y, double angle, bool highlight, bool invisible) { double rads = angle * Math.PI / 180; List <Drawer.Point> points = new List <Drawer.Point>(); points.Add(new Drawer.Point(X + 8 * Math.Cos(rads), Y + 8 * Math.Sin(rads))); points.Add(new Drawer.Point(X + 10 * Math.Cos(rads + 2 * Math.PI * 0.4), Y + 10 * Math.Sin(rads + 2 * Math.PI * 0.4))); points.Add(new Drawer.Point(X + 10 * Math.Cos(rads - 2 * Math.PI * 0.4), Y + 10 * Math.Sin(rads - 2 * Math.PI * 0.4))); Drawer.Color stroke = new Drawer.Color(0, 0, 0); if (highlight) { drawer.FillStrokePolygon(stroke, c, points, invisible); } else { drawer.FillStrokePolygon(c, stroke, points, invisible); } }
public void LoadColors() { DefaultColors(); backgroundColor = LoadColor(colorsPrefix + "Background", backgroundColor); pointColor = LoadColor(colorsPrefix + "Point", pointColor); annotationColor = LoadColor(colorsPrefix + "Annotation", annotationColor); impassableLineColor = LoadColor(colorsPrefix + "ImpassableLine", impassableLineColor); solidLineColor = LoadColor(colorsPrefix + "Line", solidLineColor); transparentLineColor = LoadColor(colorsPrefix + "TransparentLine", transparentLineColor); selectedLineColor = LoadColor(colorsPrefix + "Selection", selectedLineColor); selectedPolygonColor = LoadColor(colorsPrefix + "SelectedPolygon", selectedPolygonColor); destinationPolygonColor = LoadColor(colorsPrefix + "TargetPolygon", destinationPolygonColor); polygonColor = LoadColor(colorsPrefix + "Polygon", polygonColor); invalidPolygonColor = LoadColor(colorsPrefix + "InvalidPolygon", invalidPolygonColor); gridLineColor = LoadColor(colorsPrefix + "GridLine", gridLineColor); gridPointColor = LoadColor(colorsPrefix + "GridPoint", gridPointColor); objectColor = LoadColor(colorsPrefix + "Object", objectColor); playerColor = LoadColor(colorsPrefix + "Player", playerColor); monsterColor = LoadColor(colorsPrefix + "Monster", monsterColor); civilianColor = LoadColor(colorsPrefix + "Civilian", civilianColor); }
Gdk.Color ToGDK(Drawer.Color color) { return(new Gdk.Color((byte)(color.R * 0xff), (byte)(color.G * 0xff), (byte)(color.B * 0xff))); }