Skip to content

overview

These functions allow you to manage the visuals module in fantasy.moonlight. This includes the ESP functions and chams.

All table color parameters accept arguments of r, g, b and a as fields part of the table.

moonlight.visuals.load_image

Parameters

  • string file

Returns

  • number - The image address.
  • number - Width of the image
  • number - Height of the image.

Remarks

  • The image address is the Direct3D texture.
  • The image address can be used for moonlight.imgui.image.
  • You can only load images from your resources folder.
  • See weapon_font_test.lua for an example.

moonlight.visuals.draw_line

Parameters

  • number x
  • number y
  • number x2
  • number y2
  • table color
  • number thickness

Returns

  • number
  • number

moonlight.visuals.get_screen_size

Returns

  • number
  • number

moonlight.visuals.add_font

Remarks

  • Mirror of moonlight.imgui.add_font

moonlight.visuals.draw_string

Parameters

  • number x
  • number y
  • number id
  • table color
  • string text

Remarks

  • The id parameter requires the font ID that you can get by adding a font from moonlight.imgui.add_font or moonlight.visuals.add_font.
  • This function automatically pushes and pops a font. Therefore, you do not need to use moonlight.imgui.push_font nor moonlight.imgui.pop_font.

moonlight.visuals.draw_outlined_box

Parameters

  • number x
  • number y
  • number width
  • number height
  • table color
  • number thickness

Remarks

  • You can get the box dimensions of an entity with moonlight.game.get_box_dimensions or moonlight.game.get_render_bounds.

moonlight.visuals.draw_box

Parameters

  • number x
  • number y
  • number width
  • number height
  • table color

Remarks

  • You can get the box dimensions of an entity with moonlight.game.get_box_dimensions or moonlight.game.get_render_bounds.

moonlight.visuals.draw_triangle

Parameters

  • number point1
  • number point2
  • number point3
  • number point4
  • number point5
  • number point6
  • table color

moonlight.visuals.draw_outlined_triangle

Parameters

  • number point1
  • number point2
  • number point3
  • number point4
  • number point5
  • number point6
  • table color
  • number thickness

moonlight.visuals.draw_circle

Parameters

  • number x
  • number y
  • number radius
  • number segments
  • table color

moonlight.visuals.draw_outlined_circle

Parameters

  • number x
  • number y
  • number radius
  • number segments
  • table color
  • number thickness

moonlight.visuals.draw_bezier_cubic

Parameters

  • number x1
  • number y1
  • number x2
  • number y2
  • number x3
  • number y3
  • number x4
  • number y4
  • table color
  • number thickness

moonlight.visuals.create_material

Parameters

  • string name
  • string shader
  • string texture
  • string map
  • boolean wireframe

Returns

  • number

Remarks

  • This function returns the material address.
  • See chams.lua for an example.

moonlight.visuals.set_modulation

Parameters

  • number r
  • number g
  • number b
  • number a

Remarks

  • This function has no usage due to the OnDrawModel callback being discontinued.

moonlight.visuals.set_material_flag

Parameters

  • number material
  • number flag
  • boolean toggle

Remarks

  • See chams.lua for an example.

moonlight.visuals.apply_material

Parameters

  • number material

Remarks

  • This function has no usage due to the OnDrawModel callback being discontinued.

moonlight.visuals.add_material_flag

Parameters

  • number flag
  • boolean toggle

Remarks

  • See chams.lua for an example.