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

  • 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
  • thickness - The thickness of the line in pixels. This spreads outward to the sides in both directions from the middle.
  • 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.