Edit Article

  • 390 views
  • 3 Editors

  • Edited

When more than one ImageSprite is on a Canvas and those sprites can be dragged, then it is common for one sprite to 'capture' another if they touch. Once 'captured' the two are stuck together. To avoid this a few simple steps are required.

EditSteps

  1. 1
    Get an idea of the whole project first. What we are going to do is add a special placeholder ImageSprite to the Canvas and test inside each of your ImageSprites' Dragged event blocks to make sure it is the one that is currently being dragged. If it is the current ImageSprite then it will allow itself to be dragged. If it is not the current ImageSprite then it will not react to the event This is best shown with images from the Screen Designer and Blocks Editor.
  2. Designer.PNG
    2
    Create PlaceHolderISP ImageSprite. Uncheck it's Visible property.
  3. 3
    Create a global variable CurrentISP.
    Global.png
  4. Touched.png
    4
    Drag out TouchDown, TouchUp event blocks. For each ImageSprite, set their values as shown above.
  5. 5
    Add 'If' blocks. Does the CurrentISP variable contain the Dragged event's component value?
    If.png
  6. 6
    Your Canvas will now be free of ImageSprite cannibals!

We could really use your help!

Can you tell us about
homesteading?
Yes I can
homesteading
homesteading your home
Can you tell us about
focus groups?
Yes I can
focus groups
how to run a focus group
Can you tell us about
car stereos?
Yes I can
car stereos
how to install a car stereo
Can you tell us about
slipcovers?
Yes I can
slipcovers
how to make or buy a slipcover for a chair
Thanks for helping! Please tell us everything you know about
...
Tell us everything you know here. Remember, more detail is better.
Tips
Provide Details.
Please be as detailed as possible in your explanation. Don't worry about formatting! We'll take care of it. For example:
Don't say: Eat more fats.
Do say: Add fats with some nutritional value to the foods you already eat. Try olive oil, butter, avocado, and mayonnaise.

Article Info

Categories: Website Application Instructions

Recent edits by: Anna, Scottfromscott

Thanks to all authors for creating a page that has been read 390 times.

Did this article help you?
Yes No