protected override void Update(float time) { base.Update(time); Vector2?mousePos = _editView.MousePosition; if (mousePos.HasValue) { if (Document.Current.SelectedLayer is DocTiledLayer) { WorldCoordinates.Format(CultureInfo.InvariantCulture, "{0:n0}, {1:n0}", mousePos.Value.X, mousePos.Value.Y); } else { WorldCoordinates.Format(CultureInfo.InvariantCulture, "{0:n2}, {1:n2}", mousePos.Value.X, mousePos.Value.Y); } } else { WorldCoordinates.Clear(); } }
protected override void Draw(ref Parameters.UiViewDrawParameters parameters) { float opacity = parameters.Opacity; if (opacity == 0) { return; } var batch = parameters.DrawBatch; var drawInfo = new DrawButtonInfo(); bool hint = _text.Length == 0; bool password = _inputType == TextInputType.Password; if (password) { if (_password.Length != _text.Length) { _password.Clear(); for (int idx = 0; idx < _text.Length; ++idx) { _password.Append("●"); } } } drawInfo.Text = hint ? Hint : (password ? _password : _text); drawInfo.ButtonState = ButtonState; if (hint) { drawInfo.ButtonState |= ButtonDrawables.ButtonState.Special; } drawInfo.Target = ScreenBounds; drawInfo.Opacity = opacity; drawInfo.EllapsedTime = parameters.EllapsedTime; drawInfo.Icon = Icon.Value; for (int idx = 0; idx < _drawables.Count; ++idx) { var drawable = _drawables[idx]; drawable.Draw(batch, drawInfo); } }