Jump to content

[REL] YAML - Yet Another Menu Library v1.1.0


Lordy

Recommended Posts

Yet Another Menu Library v1.1

[attachment=0]menu.png[/attachment]

https://community.multitheftauto.com/index.php?p= ... ils&id=339

A lib for creating various menus.

Instructions:

- Copy menu_c.lua and black.png from the resource to your resource and add lines

  
    <script src="menu_c.lua" type="client" /> 
    <file src="black.png" type="client" /> 
  

to your meta.xml and you are free to use the functions

Features:

- Creating menus, dynamically managing rows, various functions for row hover, row click.

Functions:

  
 menu:create(title)  -- returns the menu 
 menu:destroy()  -- returns true 
 menu:setPosition(x,y,relative) -- returns the menu 
 menu:setSize(w,h,relative) -- returns the menu 
 menu:show() -- returns the menu 
 menu:hide() -- returns the menu 
 menu:addRow(title) -- returns the row 
 menu:setProperty(name,value) -- returns the menu   
 menu:getProperty(name) -- returns the value  
 menu:getPosition() -- returns absolute x and y 
 row:setTitle(title) -- returns the row 
 row:setProperty(propertyname,value) -- returns the row 
 row:addOnClick(function) -- returns the row 
 row:addOnEnter(function) -- returns the row 
 row:addOnLeave(function) -- returns the row 
 row:setColor(r,g,b) -- returns the row 
 row:setHoverColor(r,g,b) -- returns the row 
 row:setFont(fontname) -- returns the row 
 row:setHoverFont(fontname) -- returns the row 
 row:addSubMenu(submenutitle) returns sub menu table 
 row:getTitle() -- returns row title 
 row:getProperty(propertyname) -- returns the property value or false 
 row:getOnClick() -- returns the table with functions which are triggered onClick 
 row:getOnEnter() -- returns the table with functions which are triggered onEnter 
 row:getOnLeave() -- returns the table with functions which are triggered onLeave 
 row:getColor() -- returns a table which is {r,g,b} 
 row:getHoverColor() -- returns a table which is {r,g,b} 
 row:getFont()-- returns font name 
 row:getHoverFont() -- returns font name 
 row:getPosition(relative) -- returns x position and y position 
 row:setAlign(horizontal,vertical) -- Note that it doesn't seem to work at the moment.  
  

Comments/bugs welcome :)

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...