I am trying to implement a word search game for my project. I have created the word search letterbox using the grid and label (using this blog). Each letterbox has some words and that words are listed under the letterbox. I need to select the word hidden in the letterbox by dragging the labels. When start dragging the background color changed to orange. If the dragged word is in the words list, change the background color to green. Also, I need to capture the total, right and wrong attempts.
Please watch this video for getting a clear idea. I have also added a sample project here for the reference. I need to do the below things:
Dragging event for labels inside the grid.
Change the background color to orange(when starts dragging) and green(when the word is in the list).
A tickmark for found words.
Capture the total attempts, wrong attempts, and correct attempts.
@LeonLu I have implemented the word search game with the clicked feature of the button. When using the clicked feature we need to check the pattern is correct or not. I am uploading a sample project with this comment, hope this will help someone.
The sample contains the following features:
References:
https://github.com/neetfreek/word-search-generator/blob/master/WordSearch/WordSearch.cs
https://forums.xamarin.com/discussion/185277/xamarin-forms-how-to-add-background-color-for-clicked-button-inside-grid-word-search-game#latest
https://forums.xamarin.com/discussion/185301/xamarin-forms-grid-button-ui-breaks-when-click-restart-button#latest
Answers
Label have drag and drop gesture recognizers, you can refer to it.
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/gestures/drag-and-drop
Refer to you video, add a pan gesture recognizer is a good choose.
@LeonLu I have tried this, but the gesture is not working as expected. I have moved fingers threw one letter to another letters, only the first letter is responding. The remaining letters have no change. Also, it is very hard to gesture for the first letter. Could you please share a sample?
Due to the new policy, I cannot send any sample or demo to you, you can open an support ticket(not free) for this issue. https://support.microsoft.com/en-us/supportforbusiness/productselection?sapId=211dd84f-3474-c3c5-79bf-66db630c92a6
@LeonLu
Since the pan gesture is not working as expected I tried the MR gestures package.
I have tried the
Swiped
gesture like below, but nothing is happening when swipe on screen and how can I get the swiped letter on there?Could you suggest a nugget package for the getsure effect like the video.
Nope, I cannot find this kind of nuget packages.
I tried with drag and drop gesture recognizer in xamarin forms as well. Due to it in the experimental stage, it cannot meet your needs. Here is running gif.
Here is related code.
@LeonLu I have implemented the word search game with the clicked feature of the button. When using the clicked feature we need to check the pattern is correct or not. I am uploading a sample project with this comment, hope this will help someone.
The sample contains the following features:
References:
https://github.com/neetfreek/word-search-generator/blob/master/WordSearch/WordSearch.cs
https://forums.xamarin.com/discussion/185277/xamarin-forms-how-to-add-background-color-for-clicked-button-inside-grid-word-search-game#latest
https://forums.xamarin.com/discussion/185301/xamarin-forms-grid-button-ui-breaks-when-click-restart-button#latest