Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

TextBoxes that automatically move up or down on a SurfaceGui if one around it is removed or added?

I'm trying to devise something that uses a Trello API to get recent posts from a card onto this SurfaceGui. I've already managed to acquire the card information I just have a new problem.

I'm trying to make it so the cards appear in a list on the SurfaceGui and when a card is put on. The previous card moves down a slot. If another card is put on, it moves that card down a slot which then moves the OTHER card down a slot. If one card is removed, the others bellow fill it's spot.

Problem is, I don't even know where to start with that. I've looked at this in hopes that it'd be helpful but I'm still not sure about where to get started. I am not asking for anyone to write the whole script for me, but maybe give me a good place to start or help me figure this out. I'm sure it's been done plenty of times.

Let me know if I need to elaborate on anything, I'd be glad to.

1 answer

✓ Accepted answer

You can loop through all cards and move them all down, use a generic for loop.

local Cards = --Your gui that holds all cards

function MakeNewCard(CardInfo)

	for _,v in pairs(Cards:GetChildren()) do
		
		v.Position = v.Position - UDim2.new(0,0,ScaleYouWant,OffsetYouWant)
		
		 --Check if the card is to low on the board.
		if v.Position.Y.Offset > 500 then
		--You can also do scale, of course. "if v.Position.Y.Scale > 1 then"
		--Remove card if its to old / to many on the board
			
			v:Destroy()
		end
	end
	
	--Add new card here
end


1 comment

0

Oh, that's a great idea. Thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.