(SnapChat-like) Brush tool on Android Mobile

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
itsaloya
Posts: 4
Joined: Sun Apr 12, 2015 2:44 pm

(SnapChat-like) Brush tool on Android Mobile

Post by itsaloya » Sun Apr 12, 2015 3:01 pm

I am trying to create a SnapChat like app that allows the user to take a photo and then draw on the photo. I do the following:
1) Take a photo and place into img "myPic"
2) Create another image (img "drawArea) with rect = to img "myPic"
3) layer img "drawArea" to top
4) Choose brush tool
5) use touchMove to drag from pX to pY
6) On the desktop works well. I can draw on top of the photo
7) On Android Device (Nexus tablet) nothing happens after I choose brush tool. The photo displays, but I can't draw.

My code looks like this:

BUTTON SCRIPT:

Code: Select all

global activeTool
on mouseUp
   set the layer of image "drawArea" to top
   put true into activeTool
   choose brush tool
   set the brush to 32
end mouseUp
CARD SCRIPT:

Code: Select all

global activeTool
on openCard
   set the rect of image "drawArea" to the rect of image "myPic"
   set the layer of image "drawArea" to top
end openCard

on touchMove pID, pX, pY
   if activeTool is true then
      drag from pX to pY
   else
      exit touchMove
   end if
end touchMove
Does Android support the "Choose brush tool" command? Perhaps my drag function is incorrect?

Thank you

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: (SnapChat-like) Brush tool on Android Mobile

Post by MaxV » Thu Apr 16, 2015 12:59 pm

No brush tool on standalone. You have to use the code to create, move o modify object. So the touchmove message should contain the code to do all.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply