OurSonic.Level.Objects.LevelObjectPieceLayout.Draw C# (CSharp) Method

Draw() public method

public Draw ( CanvasRenderingContext2D canvas, int x, int y, LevelObject framework, LevelObjectInfo instance, bool showHeightMap ) : void
canvas System.Html.Media.Graphics.CanvasRenderingContext2D
x int
y int
framework LevelObject
instance LevelObjectInfo
showHeightMap bool
return void
        public void Draw(CanvasRenderingContext2D canvas, int x, int y, LevelObject framework, LevelObjectInfo instance, bool showHeightMap)
        {
            foreach (var j in instance.Pieces)
            {
                if (!j.Visible) continue;
                var piece = framework.Pieces[j.PieceIndex];
                var asset = framework.Assets[piece.AssetIndex];
                if (asset.Frames.Count > 0)
                {
                    var frm = asset.Frames[j.FrameIndex];
                    frm.DrawUI(canvas,
                               new Point((x /*+ j.X*/) - (frm.OffsetX), (y /*+ j.Y*/) - (frm.OffsetY)),
                        //                               new Point(frm.Width, frm.Height),
                               false,
                               showHeightMap,
                               showHeightMap,
                               false,
                               instance.Xflip ^ piece.Xflip,
                               instance.Yflip ^ piece.Yflip);
                }
            }
        }