-- Existing notification frame, title, and text
local dropDown = script.Parent
local titlea = dropDown.TextHolder.Title
local texta = dropDown.TextHolder.Text
-- Hide the UI element initially
dropDown.Visible = false
-- Define a function to drop down and expand the UI element
local function dropDownAndExpand()
dropDown.Position = UDim2.new(0.5, 0, -1, 0)
dropDown.Size = UDim2.new(0, 10, 0, 100)
dropDown.Visible = true
dropDown:TweenPosition(UDim2.new(0.5, 0, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.5, true)
wait(1)
dropDown:TweenPosition(UDim2.new(0.5, -200, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.5, true)
dropDown:TweenSize(UDim2.new(0.308, 0, 0.17, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.5, true)
end
-- Define a function to contract and shoot up the UI element
local function contractAndShootUp()
dropDown:TweenSize(UDim2.new(0.008, 0, 0.17, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.5, true)
dropDown:TweenPosition(UDim2.new(0.5, 0, 0, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.5, true)
wait(1)
dropDown:TweenPosition(UDim2.new(0.5, 0, -1, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.5, true)
wait(1)
dropDown.Visible = false
end
-- Define the notification function
local debounce = false
local function notification(title, text)
if debounce == false then
debounce = true
-- Set the title and text of the notification
titlea.Text = title
texta.Text = text
-- Drop down and expand the UI element after 2 seconds
wait(0.5)
dropDownAndExpand()
-- Contract and shoot up the UI element after 5 seconds
wait(5)
contractAndShootUp()
debounce = false
end
end
-- Call the notification function with custom title and text
game:GetService("ReplicatedStorage").AdministrativeEvents.NotificationEvent.OnClientEvent:Connect(function(a,b)
notification(a,b)
end)
I’m using the ClipsDescendant property to make it so the text sort of slides onto the background. However, on certain screens, this sort of cuts off as above.
How do I make it so it fits and does not cut off on all screens?
I’ve attempted to do the following:
- UI Scaling plugin
- Removing all constraints
- changing the size via script
My efforts are unsuccessful.