none
Mouse in Small Basic (for game) RRS feed

  • Question

  • Is there possibility to exchange two squares colors after two mouse clicks in this squares? What can I read or learn?
    Wednesday, September 25, 2013 5:35 AM

Answers

All replies

  • Unfortunately, there's no way to change a Shape's color after it's been created.

    What we can do is make a separate Sub to remove() and then re-add() a Shape using the new color we choose.

    As long we keep track of its reference name in a variable + its used color in another 1 for exchange purposes, we'll get that new color next time we move() it.  ^_^

    Of course, you still need to create a Sub to check whether a Shape was clicked at.


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Wednesday, September 25, 2013 6:20 AM
    Answerer
  • This is possible with an extension, eg LDShapes.BrushColour to set shape colour and LDEvents.MouseDoubleClick or LDShapes.ShapeEvent to detect clicking a shape (See sample ShapeEvents.sb).

    However, it is a good idea to work out how to do it using GoToLoops ways as well - it will help with developing programing skills.

    Wednesday, September 25, 2013 8:09 AM
    Moderator
  • Thanks, and where is the ShapeEvents.sb accessible?
    • Edited by Zurab57 Wednesday, September 25, 2013 4:13 PM
    Wednesday, September 25, 2013 4:13 PM
  • Extension download here.  This sample is included in the extension download zip.

    Wednesday, September 25, 2013 4:20 PM
    Moderator