Skip to content

button_module:new

Looobay edited this page Apr 30, 2024 · 1 revision

Summary

This function allows you to load a button in the love.load() function.

Function

button_module:new(x,y,width,height,color,text,textColor,func,center)

Arguments

  • x (number) The position of the new button (x-axis).
  • y (number) The position of the new button (y-axis).
  • width (number) Width of the button.
  • height (number) Height of the button.
  • color (table) The color of the button. (Exemple : {1,0,0} for red)
  • text (string) The text of the button.
  • textColor (table) The color of the text. (Exemple : {1,0,0} for red)
  • func (function) The function that will be executed when the button is clicked.
  • center (boolean) Determines if the text is centered.

Returns

  • Nothing.
Clone this wiki locally