Foren Foren

Zurück

Place Drag Object onto Drop Zone based on Tag List

Umschalten
Hello fellow Smartbuilders. 

I am fairly new to the visual programming language, but a long time C# developer.
In the drag and drop interaction I am building, I want to auto-move incorrect zone drops to the correct zone, based on the tag that the drop object carries.


Currently I am in a situation where I would have to hard-code every drag interaction, because I have NO idea how to check if a object carries my tag, how to confirm its the correct one, and move it to the right spot.
Can anyone help me out?


Some screenshots of what the Action blocks might look like, would be a great help to better understand this visual programming language.
Thank you very much for your time.
0 (0 Stimmen)

RE: Place Drag Object onto Drop Zone based on Tag List
Antwort
23.06.22 11:51 als Antwort auf Daniel de Ridder.
A bit of tinkering later, and I managed to put together the way I thought it would work.
(At least, how I would tackle it in different software)

But it doesnt.
Also included, a screenshot of the round-about way I implemented this functionality now, without tags. 
Deadlines are a hassle, but I would still love to learn how to implement this feature based on tags.
0 (0 Stimmen)

RE: Place Drag Object onto Drop Zone based on Tag List
Antwort
23.06.22 17:28 als Antwort auf Daniel de Ridder.
Hi Daniel,
I think you're really close, but there are a couple issues. One is a bug - this particular block (in the current release) has its labels switched. It will be resolved in our next update. (see attached "correction"). Note that when you use this block, you don't use the blue "tag list" block, because that is actually a list of all the objects (shapes, etc) that have that tag applied - instead you need use a simple text block (which is purple).

Another method of handling this is to use the tag list as a list. You can see if the last item dropped is in the list of objects tagged with "dz_both" (or whatever). You would use this block, found under the List category (see attached "as list").

If you want to send us your sb4 file (maybe save a copy of your lesson and trim to just that page), we'd be happy to record a video explanation. You can upload it here, or email us at support at smartbuilder com, and we'll post our video reply here.

Hope that helps!

- Nav
+1 (1 Stimme)

RE: Place Drag Object onto Drop Zone based on Tag List
Antwort
24.06.22 06:53 als Antwort auf Navdeep Dhillon.
Thank you Navdeep, the 'alternative' is exactly as short and concise as i was hoping the solution would be.
0 (0 Stimmen)

RE: Place Drag Object onto Drop Zone based on Tag List
Antwort
24.06.22 17:32 als Antwort auf Daniel de Ridder.
Here's a fun way to make your DnD setup/initialization easier, too.
0 (0 Stimmen)