private void Circle_TouchReleased(object sender, TouchArgs e) { if (bookshelf.TouchPoints.ContainsKey(e.TouchId) == false) { //* lock (artifactList) { ArtifactContainer selectedContainer = FindArtifactContainerFromCircle((SelectableEllipse)sender); if (selectedContainer == null) { return; } bookshelf.Library.SelectedArtifact = selectedContainer.Artifact; } //*/ } }
private void Blob_TouchReleased(object sender, TouchArgs e) { if (bookshelf.TouchPoints.ContainsKey(e.TouchId) == false) { lock (materialTiers) { int tierId; MaterialContainer selectedMaterial = FindMaterialContainerFromBlob((SelectableBlob)sender, out tierId); if (tierId == 0) { ArrayList list = materialTiers[tierId]; for (int i = 0; i < list.Count; i++) { // darken all the non-selected material colors if (list[i] != selectedMaterial) { ((MaterialContainer)(list[i])).Blob.Color = XNA.DarkenColor(((MaterialContainer)(list[i])).Blob.Color, 0.5f); ; } } materialConstraints.Add(selectedMaterial.Name); CreateMaterialBlobs(); } else { for (int i = 0; i < tierId; i++) { materialConstraints.RemoveAt(materialConstraints.Count - 1); materialTiers.RemoveAt(0); } } PackAllTiers(); animationTimer.Start(); } } }
private void Circle_TouchReleased(object sender, TouchArgs e) { if (bookshelf.TouchPoints.ContainsKey(e.TouchId) == false) { bool fastRelease = true; if (draggedText != null) { fastRelease = draggedText.FastRelease; draggedText.Mode = WavyText.DisplayMode.BounceBack; // if we fast released, this object is getting wiped out anyway, otherwise bounce back } draggedText = null; if (fastRelease) { lock (artifactCircles) { KeywordContainer selectedCircle = FindMaterialContainerFromCircle((SelectableEllipse)sender); // only do stuff if we tap on a circle that's not the center circle if (selectedCircle != artifactCircles[CENTER_CIRCLE_ID]) { bookshelf.Library.SelectedArtifact = selectedCircle.Artifact; } } } } }
private void Blob_TouchReleased(object sender, TouchArgs e) { if (bookshelf.TouchPoints.ContainsKey(e.TouchId) == false) { //* lock (materialList) { MaterialContainer selectedContainer = FindMaterialContainerFromBlob((SelectableBlob)sender); if (selectedContainer == null) { return; } if (selectedContainer.IsConstraint == false) { // if this material is in the shell (not a constraint), put it in the center and add it to the constraint list selectedContainer.IsConstraint = true; materialConstraints.Add(selectedContainer.Material); } else { // if it's in the centre, then put it on the shell and remove it from constraints selectedContainer.IsConstraint = false; if (materialConstraints.Contains(selectedContainer.Material) == true) { materialConstraints.Remove(selectedContainer.Material); } } UpdateBlobsFromConstraints(); RepositionBlobs(); UpdateArtifactsFromConstraints(); RepositionArtifacts(); animationTimer.Start(); } //*/ } }
private void Line_TouchActivated(object sender, TouchArgs e) { if (widgetTouchId != Touch.NO_ID) { // get out of here if we are touching the widgets return; } SelectableLine line = (SelectableLine)sender; if (lineArtifactDictionary.ContainsKey(line) == true) { // container is only highlighted if we are not using the timeline widgets highlightedContainer = lineArtifactDictionary[line]; } //Console.WriteLine("line was touched with id " + e.TouchId); //SelectableLine line = (SelectableLine)sender; //line.Color = Color.Black; //line.Selected = true; }
void Circle_TouchActivated(object sender, TouchArgs e) { WavyText wave = FindWavyTextFromCircle(sender as SelectableEllipse); if (wave != null && wave != draggedText && bookshelf.TouchPoints.ContainsKey(e.TouchId)) { draggedText = wave; Touch touch = bookshelf.TouchPoints[e.TouchId]; wave.DragPosition = convertTouchAbsoluteToRelative(new Vector2(touch.X, touch.Y)); wave.Mode = WavyText.DisplayMode.StraightLine; } }
private void TimelineView_TouchActivated(object sender, TouchArgs e) { if (bookshelf.TouchPoints.ContainsKey(e.TouchId) == true) { if (bookshelf.TouchPoints[e.TouchId].OriginObject == sender) { // only set the widget id if the touch in question originated on the widget // e.g. if we happened to drag our finger over top of the widget, do nothing widgetTouchId = e.TouchId; } } }
void Line_TouchReleased(object sender, TouchArgs e) { if (widgetTouchId != Touch.NO_ID) { // get out of here if we are touching the widgets return; } if (bookshelf.TouchPoints.ContainsKey(e.TouchId) == false) { // this touch release was caused by a touch up event, so the user has "SELECTED" a certain artifact SelectableLine line = (SelectableLine)sender; if (lineArtifactDictionary.ContainsKey(line) == true) { TimelineContainer container = lineArtifactDictionary[line]; bookshelf.Library.SelectedArtifact = container.Artifact; } } else { // this touch release was caused by the user scrubbing over this line // start the fade timer highlightedContainer = null; } }
void Circle_TouchReleased(object sender, TouchArgs e) { SelectableEllipse circle = sender as SelectableEllipse; //circle.Alpha = unselectedAlpha; if (bookshelf.TouchPoints.ContainsKey(e.TouchId) == false) { if (sender == englishCircle && Artifact.CurrentLanguage == Artifact.LANGUAGE_FRENCH) { Artifact.CurrentLanguage = Artifact.LANGUAGE_ENGLISH; Console.WriteLine("english selected"); frenchCircle.Alpha = unselectedAlpha; englishCircle.Alpha = selectedAlpha; bookshelf.Library.fireLanguageChangedEvent(Artifact.CurrentLanguage); } else if (sender == frenchCircle && Artifact.CurrentLanguage == Artifact.LANGUAGE_ENGLISH) { Artifact.CurrentLanguage = Artifact.LANGUAGE_FRENCH; Console.WriteLine("french selected"); englishCircle.Alpha = unselectedAlpha; frenchCircle.Alpha = selectedAlpha; bookshelf.Library.fireLanguageChangedEvent(Artifact.CurrentLanguage); } } }
void Circle_TouchActivated(object sender, TouchArgs e) { //SelectableEllipse circle = sender as SelectableEllipse; //circle.Alpha = selectedAlpha; }
void maxImageBox_TouchReleased(object sender, TouchArgs e) { currLenIndex++; if (currLenIndex >= descLengthsList.Count) currLenIndex = 0; bookshelf.Library.SelectedArtifact = descLengthsList[currLenIndex].Key; Console.WriteLine("selecting index " + currLenIndex + ", length = " + descLengthsList[currLenIndex].Value); }