Rayex.Shapes (Rayex v0.0.2) View Source

Shapes related functions

Link to this section Summary

Functions

Check if point is inside rectangle

Draw rectangle outline with extended parameters

Draw a color-filled rectangle

Draw a color-filled triangle (vertex in counter-clockwise order!)

Get collision info between ray and box

Set texture and rectangle to be used on shapes drawing

Link to this section Functions

Link to this function

check_collision_point_rec(point, rectangle)

View Source

Specs

check_collision_point_rec(
  Rayex.Structs.Vector2.t(),
  Rayex.Structs.Rectangle.t()
) :: boolean()

Check if point is inside rectangle

Link to this function

draw_line(start_x, start_y, end_x, end_y, color)

View Source

Specs

draw_line(integer(), integer(), integer(), integer(), Rayex.Structs.Color.t()) ::
  :ok

Draw a line

Specs

draw_pixel(integer(), integer(), Rayex.Structs.Color.t()) :: :ok

Draw a pixel

Link to this function

draw_rectangle_lines_ex(rectangle, line_thick, color)

View Source

Specs

draw_rectangle_lines_ex(
  Rayex.Structs.Rectangle.t(),
  integer(),
  Rayex.Structs.Color.t()
) :: :ok

Draw rectangle outline with extended parameters

Link to this function

draw_rectangle_rec(rectangle, color)

View Source

Specs

draw_rectangle_rec(Rayex.Structs.Rectangle.t(), Rayex.Structs.Color.t()) :: :ok

Draw a color-filled rectangle

Link to this function

draw_triangle(vertice1, vertice2, vertice3, color)

View Source

Specs

Draw a color-filled triangle (vertex in counter-clockwise order!)

Link to this function

get_ray_collision_box(ray, bounding_box)

View Source

Specs

Get collision info between ray and box

Link to this function

set_shapes_texture(texture, source)

View Source

Specs

set_shapes_texture(Rayex.Structs.Texture2D.t(), Rayex.Structs.Rectangle.t()) ::
  :ok

Set texture and rectangle to be used on shapes drawing