Libraries++ sneak peek

  • Global Moderator

    0_1556205903957_upload-68d13c06-4410-41ba-8fc9-47645d389777

    LA SECUELA.

  • now thats some hot stuff

  • Global Moderator

    more sneak peeks

    0_1556548575743_upload-15d76b30-bc27-4253-9e64-2fd5d7d86267

    its in a screenshot on purpose


  • @sjr04Alt

    function unpackud2(t1, t2)
    t1 = t1 or {};
    t2 = t2 or {};
    return UDim2.new(t1[1] or 0, t1[2] or 0, t2[1] or 0, t2[2] or 0)
    end
    

    please allow me to be lazy and paste a raw udim2 value from roblox studio.
    you should add this into libraries++


  • @Fifkee

    local function UnpackUDim2(UDim2Val)
         local UDim2XAxises = UDim2Val.X
         local UDim2YAxises = UDim2Val.Y
         return UDim2XAxises.Scale, UDim2XAxises.Offset, UDim2YAxises.Scale, UDim2YAxises.Offset
    end
    

    :thinking:


  • @TheAlphaStigma yours works with an actual UDim2 value

    mine works a table-shown udim2 value like how roblox studio shows it in properties

    unpackud2({0.7, 1}, {1, 3}) will return UDim2.new(0.7, 1, 1, 3) which will allow me to be a lazy poopyface and just copy and paste roblox studio's udim2 value

    actually, what would your function be used for? :thinking:
    im not calling your function useless i swear ily


  • @Fifkee A use case I can think of's when you want to get the specific axis of a side. For example, if you want to check the size of the UI, or check where it's at.

    I wrote the function 'cuz it makes more sense, 'cuz when you think of unpacking, you think of returning the values, like with tables, and not returning a UDim2 with giving two tables; that's more of a ReturnUDim2.

  • Global Moderator


  • @sjr04Alt marry me
    (your function would error if xAxes or yAxes is nil, since you'll be indexing a nil value--that's why i added default values at the top)

    also, adding an extra zero to a number would actually be very useful for things like time, or a counter system.

    function safetyZero(num)
    	if ( (tostring(num) == 'nil') or #tostring(num) == 0) then return '00' end;
    
    	num = tostring(num)
    	
    	if (#num == 1) then
    		num = '0'..num
    	end
    	
    	return num
    end
    
  • Global Moderator

    @Fifkee

    print(UDim2.new()) prints {0, 0}, {0, 0} for me.

    So it shouldnt matter

Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.