[Client] Lua Interface Functions (Render & Inputs)
Category: LuaScript | Subcategory: Main Interface Functions
Main Interface Functions
These functions enable the client to render images, texts, manage player clicks, lock/unlock interfaces, handle OpenGL blending effects, and track mouse position, among others. They are essential for customizing the interface and visual effects from Lua scripts.
Rendering Text & Images
RenderText(text, x, y, width, color, align)
Renders text at specified coordinates with customizable color and alignment.
RenderText2(x, y, string, size, align)
Renders text at the given position, with the specified font size and alignment.
RenderText3(x, y, string, align)
Renders text at the given position with specified alignment.
RenderText4(x, y, string, size, align)
Renders custom text with flexible size and alignment.
RenderText5(x, y, string, size, align)
Another custom text rendering function with a variable size and alignment.
RenderImage(ImageID, x, y, width, height)
Renders an image at the specified coordinates.
RenderImage2(ImageID, x, y, width, height, u, v, uwidth, vheight, scale, startscale, alpha)
Renders an image with UV coordinates, scaling, and transparency.
DrawBar(x, y, width, height)
Draws a bar at the specified coordinates (x, y) with the given width and height. Typically used for visual elements like party bars or health bars.
EndDrawBar()
Used to terminate the drawing of a bar initiated with DrawBar.
OpenGL Color & Blend Control
EnableAlphaTest()
Enables alpha testing for rendering (transparency handling).
EnableAlphaBlend()
Enables alpha blending for smoother transitions.
DisableAlphaBlend()
Disables alpha blending.
glColor3f(r, g, b)
Sets the color for rendering with RGB values.
glColor4f(r, g, b, a)
Sets the color with RGBA values, including transparency.
SetBlend()
Activates blending mode for smoother visual transitions.
DisableBlend()
Disables blending mode.
GLSwitchBlend()
Switches to a different blend mode.
GLSwitch()
Switches to a default OpenGL mode.
Text & Interface Font Settings
SetFontType(type)
Sets the font type (e.g., 1 for bold, 2 for large font, 0 for normal font).
SetTextBg(r, g, b, a)
Sets the background color and transparency for text.
SetTextColor(r, g, b, a)
Sets the text color with RGBA values.
Locking and Managing Interfaces
SetLockInterfaces()
Locks the interfaces, preventing interaction.
SetUnlockInterfaces()
Unlocks the interfaces to allow interaction.
LockPlayerWalk()
Locks the player's movement (e.g., for cutscenes or specific events).
UnlockPlayerWalk()
Unlocks the player's movement.
CheckWindowOpen(windowID)
Checks if a window is open by its ID.
OpenWindow(windowID)
Opens a specific window by its ID.
CloseWindow(windowID)
Closes a specific window by its ID.
FScreen_X()
Returns the horizontal screen scaling factor (g_fScreenRate_x), used to adjust elements based on screen resolution.
FScreen_Y()
Returns the vertical screen scaling factor (g_fScreenRate_y), used to adjust elements based on screen resolution.
m_NewGUI_ResizeX(value)
Adjusts the value value based on the horizontal scaling factor of the screen resolution. It uses the screen resolution ratio relative to 800 pixels.
m_NewGUI_ResizeY(value)
Adjusts the value value based on the vertical scaling factor of the screen resolution. It uses the screen resolution ratio relative to 600 pixels.
m_NewGUI_resizeGuiRateX()
Returns the horizontal GUI scale rate value multiplied by an additional scale factor. Used to adjust interface elements.
m_NewGUI_resizeGuiRateY()
Returns the vertical GUI scale rate value multiplied by an additional scale factor.
m_NewGUI_resizeGuiRate()
Returns the overall GUI scale rate value.
Mouse and Click Detection
CheckClickClient()
Checks if a click has occurred in the client interface.
DisableClickClient()
Disables click detection in the client interface.
MousePosX()
Returns the current X position of the mouse.
MousePosY()
Returns the current Y position of the mouse.
m_NewGUI_CheckCursor(x1, y1, x2, y2)
Checks if the mouse cursor is inside the specified rectangular area defined by the coordinates (x1, y1) for the top-left corner and (x2, y2) for the bottom-right corner.
Player Movement and Interaction
CheckRepeatKey(key)
Checks if a key is being held down (repeatedly pressed).
CheckPressedKey(key)
Checks if a key has been pressed.
CheckReleasedKey(key)
Checks if a key has been released.
CheckDistance(arrayIndex, distance)
Checks the distance between the player and another object (e.g., another player or monster).
Item and Guild Management
CreateItem(x, y, width, height, ItemIndex, level, ancient, unknown)
Creates and displays an item in the interface.
ShowItemDescription(x, y, ItemIndex, level, op1, op2, op3, durability, exc, ancient)
Displays the description of an item at specified coordinates.
ShowDescriptionComplete(x, y, level, op1, op2, op3, exc, ancient, joh, sockbonus, sock1, sock2, sock3, sock4, sock5)
Displays a detailed description of an item, including sockets, options, and other attributes.
CreateGuildMark(markIndex)
Creates a guild mark (icon) for the player's guild.
Other Utility Functions
getFPS()
Returns the current FPS (frames per second) of the client.
getPing()
Returns the current ping to the server in milliseconds.
GetImageWidth(imageID)
Returns the width of an image.
GetImageHeight(imageID)
Returns the height of an image.
LuaOpenMenuGame(Type, ID)
Opens a game menu (MainInfo):
Type 0 = Classic Menu
Type 1 = Update Menu
ID = Menu ID.
ReturnWideScreenX()
Returns the X position based on a wide-screen layout.
ReturnWideScreenY()
Returns the Y position based on a wide-screen layout.
CheckMuunInventory()
Checks if the Muun inventory UI is open.
CheckUIJewelsBank()
Checks if the Jewels Bank UI is open.
CheckUIMenuInGame()
Checks if the in-game menu UI is active.
CreateWindowsUpgrade(x, y)
Creates a window for upgrading.
CreateWindowsUpgrade1(x, y, h)
Creates a window for upgrading.
CreateWindowsDowngrade(x, y, w, h)
Creates a window for downgrading.
HideAllInterface()
Hides all UI elements temporarily.
Conclusion
These functions enable detailed control over the client interface, allowing for dynamic rendering of text, images, input handling, and seamless player interaction with the game's UI. The Lua script functions provide great flexibility for customizing the gaming experience.