Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / T1 Drawing Functionality

Author
Message
Swissed
7
Years of Service
User Offline
Joined: 7th Dec 2016
Location:
Posted: 31st Dec 2016 08:20
Hi friends!

I am trying to make a quick, simple drawing tool for user input for my app but not sure I'm going about it the right way.

What I've tried so far: (1) placing a sprite at every point hit while the user was moving their finger around - when I moved my finger too fast the points became very spread out so this didn't work and (2) the same method as earlier but modifying the previous sprite to bridge the gap - it looks mostly fine now but when I draw a sharp corner the line sticks out sharply.

Here is my current function but again, I'm probably trying to do this the hard way & would appreciate any help! Don't need any edit / undo/ etc capabilities, just need to let the user draw briefly!

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st Dec 2016 09:48
I did this a while ago...and mislaid the code It was for saving digital signatures.

My method was to save coordinates whenever the pointer moved 5 pixels, and it gave quite a smooth result by aligning and drawing a sprite between each of the coordinates.
It also allowed me to erase the line by removing the coordinates from the array, and change the thickness of the line by resizing the sprite.
After drawing the line, you could refine it by adding additional points in between the ones saved, or use the coordinates to convert it to a bezier curve.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Swissed
7
Years of Service
User Offline
Joined: 7th Dec 2016
Location:
Posted: 31st Dec 2016 23:52
Got it working! Thank you for always taking the time to reply and helping out the newbies!!

Login to post a reply

Server time is: 2024-09-29 21:24:40
Your offset time is: 2024-09-29 21:24:40