DrawThickLine

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


Screen

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

Usage

Draws a line from the first coordinate to the second coordinate with a specified thickness. Drawn lines do not scale with virtual canvases and are always based on the real resolution. 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

  • int x0
The x coordinate of the first point to draw from.
  • int y0
The y coordinate of the first point to draw from.
  • int x1
The x coordinate of the second point to draw to.
  • int y1
The y coordinate of the second point to draw to.
  • double thickness
The thickness of the line in pixels. This spreads outward to the sides in both directions from the middle.
  • Color color
The color to use for the line.
  • int alpha
The opacity of the line in a [0, 255] range. Default is 255 (fully opaque).

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.