BloxUI [BETA] - This is small UI scripting library and little tutorial for UI scripting

So topic tell you about this

To use library you should have this in your code first

local BloxUI = require(13133329143)

this is function list with document

.

  • media_query_min(query: table, func: function): void
local exampleQuery = {
   ["width"] = 1300, -- pixel unit
   ["height"] = 1000 -- pixel unit
} -- you don't need to set every value like this table

local exampleFunction = function() print("Hello") end

BloxUI:media_query_min(exampleQuery, exampleFunction)

-- If user screen width is less than 1300(px) and screen height lass than 1000(px)
-- It will print "Hello"

.

  • media_query_max(query: table, func: function): void
    Same as media_query_min() but condition is equal or more than

.

  • get_viewport_height(percent: number/nil): number
local vh = BloxUI:get_viewport_height(50) -- You can just use function with out parameter it will automatic return 100 percent

.

  • get_viewport_width(percent: number/nil): number
local vw = BloxUI:get_viewport_width(50) -- You can just use function with out parameter it will automatic return 100 percent

.

This is little tutorial to make responsive UI

  1. Use scale property for GUI size/position

This is a good tutorial. But I did use offset properties, does it also work?

Yes, but use with scale will be the best option. Because scale will change by player screen size, but offset will be absolute data where not change by viewport size.