[Module] Custom GUI -Unofficial

The Lua scripting language allows you to give your plugin more advanced features.

Moderator: Plugin Moderators

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

[Module] Custom GUI -Unofficial

#1

Post by ian` »

This is an unofficial GUI functions that i made for other plugin creators.

How To Use
Place the module in the same folder with the main script. This module can be called by using require function like this:

Code: Select all    Reset

local funName = require('moduleName.plugin/module/moduleName.lua') -- funName can be replaced with another name you want to use. moduleName can be replaced only by the file name you download from this post.
Interactive Lua editor
Run
runText GUI
Show
This function can be used for a text that longer than the parent GUI.
running label.png
running label.png (18.99 KiB) Viewed 6063 times

Code: Select all    Reset

local runText = require('runText.plugin/module/runText.lua') -- runText(args) -- Parameters : -- args : (table) A table that contains the source, text, and optional values. -- Returns : -- (table) A table that contains the label. -- Usage : runText{ source = parent, -- Attaches the label to this object. The X, Y, Width, Height parameters will follow this object as parent. w = 128, -- Sets the width of the label. Default the width of the source. (optional) h = 26, -- Sets the height of the label. Default the height of the source. (optional) id = '$runningText', -- Id for the label. (optional) text = 'string' or function() return value end, -- A text to display. String is used for fixed values. Function is used for changeable values. color = {256,256,256}, -- (table) Sets the color of the text. Default {256,256,256} white. (optional) font = Font.DEFAULT, -- Sets the font of the text. Default Font.DEFAULT. (optional) speed = 0.5 -- Sets the speed of the text movements. Default 0.5. (optional) }
Interactive Lua editor
Run
Download :
runText.plugin
(993 Bytes) Downloaded 126 times
moveButton GUI
Show
This function can be used for create a movable button.
movable button.png
movable button.png (19.5 KiB) Viewed 6063 times

Code: Select all    Reset

local moveButton = require('moveButton.plugin/module/moveButton.lua') -- moveButton(args) -- Parameters : -- args : (table) A table that contains the button. -- Returns : -- (table) A table that represents the button. -- Usage : moveButton{ x = 30, -- Sets the x. Default 30. (optional) y = 30, -- Sets the y. Default 30. (optional) w = 0, -- Sets the width. Default 0 or same as the height. (optional) h = 26, -- Sets the height. Default 26. (optional) index = 10, -- Sets the child index of the button. Useful if a button should in the background or foreground of another GUI. Default 10. (optional) icon = Icon.OK, -- Sets the icon of the button. frameDefault = NinePatch.BUTTON, -- Sets the default frame of the button. Default NinePatch.BUTTON. (optional) frameDown = NinePatch.BUTTON, -- Sets the pressed frame of the button. Default NinePatch.BUTTON_DOWN. (optional) saveValue = function(x,y) -- A function to save the new position of x and y coordinates into storage. local storage -- the storage variable storage.x = x storage.y = y end, onClick = function() -- Will be called when the button gets clicked Debug.toast('Hello World') end }
Interactive Lua editor
Run
Download :
moveButton.plugin
(1.02 KiB) Downloaded 114 times
splitLabel GUI
Show
This function can be used for a long text that can be placed in listbox or anythings.
longtext.PNG
longtext.PNG (36.5 KiB) Viewed 5851 times

Code: Select all    Reset

local splitLabel = require('splitLabel.plugin/module/splitLabel.lua') -- splitLabel(args) -- Parameter : -- args : (table) a table that contains source, text, padding, color, and font. -- Returns : -- (table) A table that contains the long text. -- Usage : splitLabel{ source = parent, -- Attaches the label to this object. The X, Y, Width, Height parameters will follow this object as parent. text = 'string', -- A text to display. the long text will be automatically split and the total row will be calculated depends on the parent width. color = {0,0,0}, -- (table) Sets the color of the text. Default {0,0,0} black. (optional) font = Font.DEFAULT, -- Sets the font of the text. Default Font.DEFAULT. (optional) padding = {2,0,5,0} -- (table) Sets the padding (left,top,right,bottom) of the label. Default {2,0,5,0}. (optional) }
Interactive Lua editor
Run
Download :
splitLabel.plugin
(1019 Bytes) Downloaded 122 times
 ! Message from: ian`
Don't use Lua Wrapper when you using the require function, because it will occur an error. You can use this function when you are done with other stuff on your script. If you upload your plugin and it contains this module, please set the minimum version to at least 1949.
Off Topic
This module is free to use. Give me a credit in your plugins is optional, but you can benefit from doing so.
Last edited by ian` on 01 Mar 2021, 13:42, edited 3 times in total.

User avatar
PixelDubs
Inhabitant of a Conurbation
Reactions:
Posts: 529
Joined: 02 Nov 2020, 20:14
Location: Telford, England
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Custom GUI -Unofficial

#2

Post by PixelDubs »

Can you show me a picture before it starts using all my cache from lua?

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Custom GUI -Unofficial

#3

Post by ian` »

LZS Gaming wrote:
30 Jan 2021, 13:52
Can you show me a picture before it starts using all my cache from lua?
sorry, what kind of picture? i don't understand. :bq

User avatar
PixelDubs
Inhabitant of a Conurbation
Reactions:
Posts: 529
Joined: 02 Nov 2020, 20:14
Location: Telford, England
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Custom GUI -Unofficial

#4

Post by PixelDubs »

ian` wrote:
30 Jan 2021, 15:08
LZS Gaming wrote:
30 Jan 2021, 13:52
Can you show me a picture before it starts using all my cache from lua?
sorry, what kind of picture? i don't understand. :bq
A screenshot of the plugin.

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Custom GUI -Unofficial

#5

Post by ian` »

LZS Gaming wrote:
30 Jan 2021, 15:32
A screenshot of the plugin.
there is sample code in rar file. You can try it.

anyway, this is not a complete plugin. this is just a module for plugin creators who want to add features like my plugins. (e.g. shortcut box or part of the animation dev. tool). and also i post this in tutorial and documentation, not in plugin showcase. :teach :plugin

User avatar
Hadestia
Inhabitant of a Megalopolis
Reactions:
Posts: 727
Joined: 17 Jul 2017, 16:16
Location: Philippines
Plugins: Showcase Store
Contact:

Plugin Creator

Platform

Re: Custom GUI -Unofficial

#6

Post by Hadestia »

I'm waiting for these Awesome job ! One more thing is there any "text" Parameters for that movable button?

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: Custom GUI -Unofficial

#7

Post by ian` »

rjroldan1 wrote:
30 Jan 2021, 20:25
I'm waiting for these Awesome job ! One more thing is there any "text" Parameters for that movable button?
i'm not going to include any text for the movable button because i anticipate if it's too wide, it will block the screen. :calc

User avatar
ian`
Supporter
Reactions:
Posts: 117
Joined: 04 Apr 2020, 17:36
Location: Indonesien
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [Module] Custom GUI -Unofficial

#8

Post by ian` »

update : splitLabel. :bc:

User avatar
Hadestia
Inhabitant of a Megalopolis
Reactions:
Posts: 727
Joined: 17 Jul 2017, 16:16
Location: Philippines
Plugins: Showcase Store
Contact:

Plugin Creator

Platform

Re: [Module] Custom GUI -Unofficial

#9

Post by Hadestia »

Splitlabel require throws me an exceptions

Post Reply Previous topicNext topic

Return to “Lua Scripting”