private void InitCorner(string actionText, CornerPoint cornerPoint, ActionType actionType, Action finishedCallback) { // corner point adjustments var rectTransform = this.transform as RectTransform; rectTransform.anchorMin = cornerPoint.ToVector2(); rectTransform.anchorMax = cornerPoint.ToVector2(); rectTransform.pivot = cornerPoint.ToVector2(); rectTransform.anchoredPosition = Vector2.zero; bool isLeft = cornerPoint.IsLeft(); backdropImage_.transform.localScale = backdropImage_.transform.localScale.SetX(isLeft ? 1.0f : -1.0f); fillImage_.transform.localScale = fillImage_.transform.localScale.SetX(isLeft ? 1.0f : -1.0f); if (screenDirectionTransition_ != null) { screenDirectionTransition_.SetInDirection(isLeft ? Direction.LEFT : Direction.RIGHT); screenDirectionTransition_.SetOutDirection(isLeft ? Direction.LEFT : Direction.RIGHT); } bool isBottom = cornerPoint.IsBottom(); backdropImage_.transform.localScale = backdropImage_.transform.localScale.SetY(isBottom ? 1.0f : -1.0f); fillImage_.transform.localScale = fillImage_.transform.localScale.SetY(isBottom ? 1.0f : -1.0f); mainLayoutGroup_.padding.left = isLeft ? 0 : 30; mainLayoutGroup_.padding.right = isLeft ? 30 : 0; Init(actionText, actionType, finishedCallback); }
// PRAGMA MARK - Static Public Interface public static CornerDelayedActionView Show(string actionText, CornerPoint cornerPoint, ActionType actionType, Action finishedCallback) { var view = ObjectPoolManager.CreateView <CornerDelayedActionView>(GamePrefabs.Instance.DelayedActionViewPrefab); view.InitCorner(actionText, cornerPoint, actionType, finishedCallback); return(view); }
public Block(string info) { var par = info.Split(' '); Width = Int32.Parse(par[0]); Length = Int32.Parse(par[1]); Height = Int32.Parse(par[2]); Front = new Face(par[3][0], 'F'); Back = new Face(par[3][1], 'B'); Down = new Face(par[3][2], 'D'); Up = new Face(par[3][3], 'U'); Left = new Face(par[3][4], 'L'); Right = new Face(par[3][5], 'R'); Point = new CornerPoint(); }
/// <summary> /// this method fills data from the respective data adapter to the list of corner points /// </summary> private void FillCorners() { DataTable dt = dataSetObjCorners.Tables["CornerPoints"]; foreach (DataRow r in dt.Rows) { CornerPoint newPoint = new CornerPoint(); newPoint.cornerNum = Convert.ToUInt64(Convert.ToString(r[1])); newPoint.coordX = Convert.ToDouble(Convert.ToString(r[2])); newPoint.coordY = Convert.ToDouble(Convert.ToString(r[3])); newPoint.SRS = Convert.ToInt32(Convert.ToString(r[4])); listOfPoints.Add(newPoint); } }
/// <summary> /// this method is used to return specified corner point from an array /// </summary> /// <param name="pointStrID">registration number of the point that should be returned</param> /// <returns>corner point with the specified number</returns> private CornerPoint ReturnCorner(string pointStrID) { ulong pointID = Convert.ToUInt32(pointStrID); CornerPoint point = new CornerPoint(); foreach (CornerPoint element1 in listOfPoints) { if (element1.cornerNum == pointID) { point = element1; } } return(point); }
private void btnGray_Click(object sender, EventArgs e) { if (bingLine.Count > 0) { mf.TimedMessageBox(2000, gStr.gsBoundary, "Finish Making Boundary"); return; } double nor = 0; double eas = 0; //mapControl.Markers.Clear(); //mapControl.Invalidate(); mf.worldGrid.isGeoMap = true; CornerPoint geoRef = mapControl.TopLeftCorner; mf.pn.ConvertWGS84ToLocal(geoRef.Latitude, geoRef.Longitude, out nor, out eas); if (Math.Abs(nor) > 4000 || Math.Abs(eas) > 4000) { mf.worldGrid.isGeoMap = false; } mf.worldGrid.northingMaxGeo = nor; mf.worldGrid.eastingMinGeo = eas; geoRef = mapControl.BottomRightCorner; mf.pn.ConvertWGS84ToLocal(geoRef.Latitude, geoRef.Longitude, out nor, out eas); if (Math.Abs(nor) > 4000 || Math.Abs(eas) > 4000) { mf.worldGrid.isGeoMap = false; } mf.worldGrid.northingMinGeo = nor; mf.worldGrid.eastingMaxGeo = eas; if (!mf.worldGrid.isGeoMap) { mf.TimedMessageBox(2000, "Map Error", "Map Too Large"); ResetMapGrid(); return; } Bitmap bitmap = new Bitmap(mapControl.Width, mapControl.Height); mapControl.DrawToBitmap(bitmap, new Rectangle(0, 0, bitmap.Width, bitmap.Height)); if (!isColorMap) { bitmap = glm.MakeGrayscale3(bitmap); } GL.BindTexture(TextureTarget.Texture2D, mf.texture[20]); BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, bitmapData.Width, bitmapData.Height, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, bitmapData.Scan0); bitmap.UnlockBits(bitmapData); if (mf.worldGrid.isGeoMap) { cboxDrawMap.Image = Properties.Resources.MappingOn; } isColorMap = !isColorMap; if (isColorMap) { btnGray.Image = Properties.Resources.MapColor; } else { btnGray.Image = Properties.Resources.MapGray; } }