DrawLine

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


Screen

native static void DrawLine(int x0, int y0, int x1, int y1, Color color, int alpha = 255)

Usage

Draws a line from the first coordinate to the second coordinate. The automap uses this to draw walls. Drawn lines do not scale with virtual canvases and are always based on the real resolution. If lines with a thickness greater than one pixel are desired, DrawThickLine should be used instead. Coordinates are absolute and start from the top left of the screen with positive x values shifting to the right and positive y values shifting downward.

Warning: This can only be called from within functions that are specifically designed to draw HUD elements (e.g. BaseStatusBar's Draw or EventHandler's RenderOverlay).

Parameters

  • x0 - The x coordinate of the first point to draw from
  • y0 - The y coordinate of the first point to draw from
  • x1 - The x coordinate of the second point to draw to
  • y1 - The y coordinate of the second point to draw to
  • color - The color to use for the line
  • alpha - Default is 255. The alpha value of the line. 255 is fully opaque while 0 is fully transparent

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.