Now I am trying to use different tools to create a picture and want to select between the different tools. This is the code I think I need to use. Am I even heading in the right direction.
On the tool buttons
on mouseUp
put "spray can" into currentToolUse
end mouseUP
in the drawing area
global currentToolUse
on mouseEnter
global currentToolUse
choose currentToolUse tool
end mouseEnter
on mouseLeave
choose browser tool
end mouseLeave
Selecting tools
Moderators: LCNeil, heatherlaine, kevinmiller, elanorb
Re: Selecting tools
Hi Mark,
I see that you have posted in the general forums and had a few responses but I will attempt to help here as well.
Yes, you are on the right path. You can use a global variable to select a tool and then have this activated when the mouse enters the draw area.
You almost had the script correct for your tool button. You will want to ensure that you have your global variable defined and the correct syntax for the tool. The below is an example of how to select a tool with one button and then set the current tool to it
(button1)
global currentToolUse
on mouseUp
put "spray can" into currentToolUse
end mouseUp
(button2)
global currentToolUse
on mouseUp
choose quote & currentToolUse & quote && "tool"
end mouseUp
This should hopefully give you some leads with implementing this functionality in your stack.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
I see that you have posted in the general forums and had a few responses but I will attempt to help here as well.
Yes, you are on the right path. You can use a global variable to select a tool and then have this activated when the mouse enters the draw area.
You almost had the script correct for your tool button. You will want to ensure that you have your global variable defined and the correct syntax for the tool. The below is an example of how to select a tool with one button and then set the current tool to it
(button1)
global currentToolUse
on mouseUp
put "spray can" into currentToolUse
end mouseUp
(button2)
global currentToolUse
on mouseUp
choose quote & currentToolUse & quote && "tool"
end mouseUp
This should hopefully give you some leads with implementing this functionality in your stack.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
Re: Selecting tools
I think I am missing something simple here. If I select the spray can button in run mode and try to draw all I get is a blank screen. If I look in the project browser I see an item title image.
I am assuming this part of the script will go into the drawing area.
I am assuming this part of the script will go into the drawing area.
Re: Selecting tools
Hi Mark,
You may be seeing a blank screen as your brushColor might be set to white. This would give the impression that nothing is being drawn on screen.
Please find attached a sample stack that should be able to assist with selecting tools, changing colors, clearing a draw area and setting the tool to browse when a mouseLeave is triggered from an image area
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
You may be seeing a blank screen as your brushColor might be set to white. This would give the impression that nothing is being drawn on screen.
Please find attached a sample stack that should be able to assist with selecting tools, changing colors, clearing a draw area and setting the tool to browse when a mouseLeave is triggered from an image area
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
- Attachments
-
- color.livecode.zip
- (1.39 KiB) Downloaded 197 times