public static void buildBottomEmpty(RaphaelPaper _context, int x, int y) { var xxx = ( y % 2 == 1 ? ( ( x + 0.5f ) * ArmLength ) : ( x * ArmLength ) ) + IsoGame.Offset.X; var yyy = y * ArmLength / 4f + IsoGame.Offset.Y; var em = _context.Set(); RaphaelElement elem; elem=_context.Path(string.Format("M{0} {1}L{2} {3}L{4} {5}L{6} {7}L{0} {1}", xxx - ArmLength / 2 , yyy, xxx, yyy - ArmLength / 4 , xxx + ArmLength / 2 , yyy, xxx, yyy + ArmLength / 4 )) ; elem.Attribute(new RaphaelElementAttributes() { Fill = "rgba(0,0,0,0)", StrokeWidth =1, Stroke = "black" }); elem.MouseOver((e) => { elem.Attribute(new RaphaelElementAttributes() { Fill = "rgba(0,0,0,0)", StrokeWidth = 4, Stroke = "black" }); }); elem.MouseOut((e) => { elem.Attribute(new RaphaelElementAttributes() { Fill = "rgba(0,0,0,0)", StrokeWidth = 1, Stroke = "black" }); }); em.Push(_context.Circle(xxx - ArmLength / 2, yyy, 3)); // em.Push(_context.Circle(xxx, yyy - ArmLength / 4, 3)); // em.Push(_context.Circle(xxx + ArmLength / 2, yyy, 3)); // em.Push(_context.Circle(xxx, yyy + ArmLength / 4, 3)); em.Attribute(new RaphaelElementAttributes() {StrokeLineCap = RaphaelLineCap.Round, StrokeLineJoin = RaphaelLineJoin.Round}); em.Attribute(new RaphaelElementAttributes() {Fill = "black", StrokeWidth = 4, Stroke = "black"}); }
public RaphaelPaperSet build(RaphaelPaper context, int X, int Y) { myContext = context; var x = X; var y = Y; var xxx = ( y % 2 == 1 ? ( ( x + 0.5f ) * ArmLength ) : ( x * ArmLength ) ) + IsoGame.Offset.X; var yyy = y * ArmLength / 4f + IsoGame.Offset.Y; startxxx = xxx; startyyy = yyy; var set = context.Set(); set.Push(LeftWall = buildLeft(context)); set.Push(RightWall = buildRight(context)); set.Push(TopWall = buildTop(context)); set.MouseOver(e => { set.Attribute(new RaphaelElementAttributes() {StrokeWidth = 3}); }); set.MouseOut(e => { set.Attribute(new RaphaelElementAttributes() {StrokeWidth = 1}); }); set.Attribute(new RaphaelElementAttributes() {StrokeLineCap = RaphaelLineCap.Round, StrokeLineJoin = RaphaelLineJoin.Round}); set.Attribute(new RaphaelElementAttributes() {Fill = Color, StrokeWidth = 1, Stroke = "black"}); return set; }