Forum Discussion
Drag and drop
I need to colour the object with the brush, but the problem is I can only colour 1 object at 1 time. can anyone suggest to me how I can do this? please note: I don't want to duplicate the brush.
- WaltHamiltonSuper Hero
I would make this a click and color, rather than a drag and color. It is a lot easier for learners that may not have perfect eye-hand coordination, or may be using tablets or phones.
Either way, the principle is that a color is chosen, then the object, then the object changes state. So you need five states for each object: one for no color, and one which is filled for each color. You may want to create a method to set it back to no color, or you may not.
Click and color
You need some method for the system to know which color is chosen. The easiest and simplest is to use a variable. For example: “colorChosen”. Then a trigger: “Set variable colorChosen to “red” when user clicks [red brush]. Then create a trigger: “Change state of object1 to [red state] when the learner clicks object1 if colorChosen = red”. Duplicate the trigger for each color, and repeat for each object.
Drag and Color
For each brush, create a motion path. Line is the easiest. Set its length to 0, and delete the automatic trigger that is created to move on that path when the timeline starts. Create two triggers for each brush: “Change state of object1 to Yellow when [yellow brush] is dropped on object1”. Then “Move [yellow brush] on line motion path 1 when [yellow brush] is dropped on object1” (To return it so you can use it again). Repeat for all colors, and repeat all of them for all brushes.
See the attached sample for some ideas to get you started with a click to color.
If you have problems, attach your .story file here, so someone can take a look at it.
- VikasYadav-7fa2Community Member
As you suggested for drag and colour, we are doing the same thing that you mention, the problem is when we drag multiple times to colour an object then the other brushes are hidden automatically. I am sharing a file please check this. just colour the object multiple time.
please note this activity is only for primary class.
- WaltHamiltonSuper Hero
When you drag an object, it is moved to be on top of everything else, so it can be seen while you are dragging it. What is happening with your project is that somehow, the previous brush is moved to behing the brush bounding box at the same time. Something may be corrupted, or it is a bug. I suggest opening a support case.