/// <inheritdoc /> public override void Draw() { base.Draw(); // Cache data var style = Style.Current; Render2D.DrawText(style.FontSmall, Archetype.Text, new Rectangle(Vector2.Zero, Size), Enabled ? style.Foreground : style.ForegroundDisabled, TextAlignment.Near, TextAlignment.Center); }
/// <inheritdoc /> public override void Draw() { base.Draw(); // Draw accent const float accentHeight = 2; Render2D.FillRectangle(new Rectangle(0, Height - accentHeight, Width, accentHeight), AccentColor); }
/// <inheritdoc /> public override void Draw() { base.Draw(); if (HighlightStripColor.A > 0.0f) { Render2D.FillRectangle(new Rectangle(0, 0, 2, Height), HighlightStripColor); } }
/// <inheritdoc /> public override void Draw() { base.Draw(); var color = Style.Current.Background * 0.8f; Render2D.DrawLine(new Vector2(Width, 0), new Vector2(Width, Height), color); Render2D.DrawLine(new Vector2(0, 48), new Vector2(Width, 48), color); }
public override void Draw() { var style = Style.Current; if (IsMouseOver || _clicked) { Render2D.FillRectangle(new Rectangle(Vector2.Zero, Size), _clicked ? style.BackgroundSelected : style.BackgroundHighlighted); } }
public void Create() { map = new Map(); hero = new Hero(); render2D = new Render2D(map, hero); render3D = new Render3D(map, hero); Console.WindowHeight = SCREEN_HEIGHT; Console.CursorVisible = false; }
/// <inheritdoc /> public override void Draw() { base.Draw(); var style = Style.Current; var color = Enabled ? style.Foreground : style.ForegroundDisabled; Render2D.DrawText(style.FontSmall, Archetype.Text, new Rectangle(Float2.Zero, Size), color, TextAlignment.Near, TextAlignment.Center); }
/// <inheritdoc /> public override void Draw() { var style = Style.Current; var moveColor = style.ProgressNormal; var thickness = 2.0f; var borderColor = _isMoving ? moveColor : (IsMouseOver && _canEdit ? Color.Yellow : style.BorderNormal); Render2D.FillRectangle(new Rectangle((Width - thickness) * 0.5f, 0, thickness, Height), borderColor); }
/// <inheritdoc /> public override void Draw() { // Draw backbuffer texture var buffer = _backBufferOld ? _backBufferOld : _backBuffer; var color = TintColor.RGBMultiplied(Brightness); Render2D.DrawTexture(buffer, new Rectangle(Vector2.Zero, Size), color); base.Draw(); }
/// <inheritdoc /> public override void Draw() { // Draw background var style = Style.Current; Render2D.FillRectangle(new Rectangle(0, 0, Width, Height), style.Background); Render2D.DrawRectangle(new Rectangle(0, 0, Width - 1.5f, Height - 1.5f), Color.LerpUnclamped(style.BackgroundSelected, style.Background, 0.6f)); base.Draw(); }
/// <inheritdoc /> public override void Draw() { if (IsDragOver && _currentDragEffect != DragDropEffect.None) { var style = Style.Current; Render2D.FillRectangle(new Rectangle(Vector2.Zero, Size), style.BackgroundSelected * 0.4f); } base.Draw(); }
/// <inheritdoc /> public override void Draw() { // Cache data var isSelected = _editor.SelectedIndex == _index; // Draw rotated rectangle Render2D.PushTransform(ref _transform); Render2D.FillRectangle(new Rectangle(0, 0, 5, 5), isSelected ? Color.Orange : Color.BlueViolet); Render2D.PopTransform(); }
/// <inheritdoc /> public override void Draw() { base.Draw(); // Check if drag is over if (IsDragOver && _validDragOver) { Render2D.FillRectangle(new Rectangle(Vector2.Zero, Size), Style.Current.BackgroundSelected * 0.6f); } }
/// <inheritdoc /> public override void Draw() { base.Draw(); // Draw border if (!IsFocused) { Render2D.DrawRectangle(new Rectangle(Float2.Zero, Size), Style.Current.BorderNormal); } }
/// <inheritdoc /> public override void Draw() { // Draw backbuffer texture var buffer = _backBufferOld ? _backBufferOld : _backBuffer; var color = TintColor * Brightness; Render2D.DrawRenderTarget(buffer, new Rectangle(Vector2.Zero, Size), color); base.Draw(); }
/// <inheritdoc /> public override void Draw() { var style = Style.Current; // Background var backgroundRect = new Rectangle(Vector2.Zero, Size); Render2D.FillRectangle(backgroundRect, BackgroundColor); // Breakpoint hit if (Breakpoint.Hit) { var colorTop = Color.OrangeRed; var colorBottom = Color.Red; var time = DateTime.Now - Engine.StartupTime; Render2D.DrawRectangle(backgroundRect.MakeExpanded(Mathf.Lerp(3.0f, 12.0f, Mathf.Sin((float)time.TotalSeconds * 10.0f) * 0.5f + 0.5f)), colorTop, colorTop, colorBottom, colorBottom, 2.0f); } // Header var headerColor = style.BackgroundHighlighted; if (_headerRect.Contains(ref _mousePosition)) { headerColor *= 1.07f; } Render2D.FillRectangle(_headerRect, headerColor); Render2D.DrawText(style.FontLarge, Title, _headerRect, style.Foreground, TextAlignment.Center, TextAlignment.Center); // Close button if ((Archetype.Flags & NodeFlags.NoCloseButton) == 0) { Render2D.DrawSprite(style.Cross, _closeButtonRect, _closeButtonRect.Contains(_mousePosition) && Surface.CanEdit ? style.Foreground : style.ForegroundGrey); } // Footer Render2D.FillRectangle(_footerRect, FooterColor); DrawChildren(); // Selection outline if (_isSelected) { var colorTop = Color.Orange; var colorBottom = Color.OrangeRed; Render2D.DrawRectangle(backgroundRect, colorTop, colorTop, colorBottom, colorBottom); } // Breakpoint dot if (Breakpoint.Set) { var icon = Breakpoint.Enabled ? Surface.Style.Icons.BoxClose : Surface.Style.Icons.BoxOpen; Render2D.DrawSprite(icon, new Rectangle(-7, -7, 16, 16), new Color(0.9f, 0.9f, 0.9f)); Render2D.DrawSprite(icon, new Rectangle(-6, -6, 14, 14), new Color(0.894117647f, 0.0784313725f, 0.0f)); } }
/** 作成。 * * 「DRAWPRIORITY_STEP」ごとに描画カメラが切り替わる。 * 同一カメラ内では必ずテキストが上に表示される。 * テキストの上にスプライトを表示する場合は、描画カメラが切り替わるようにプライオリィを設定する必要がある。 * */ public static InputField2D Create(Fee.Deleter.Deleter a_deleter, long a_drawpriority) { InputField2D t_this = Fee.Render2D.Render2D.GetInstance().GetInputFieldList().PoolNew(); { //どこから確保されたのか。 #if (UNITY_EDITOR) { try{ System.Text.StringBuilder t_stringbuilder = new System.Text.StringBuilder(Config.DEBUG_TRACECOUNT * 32); for (int ii = Config.DEBUG_TRACECOUNT; ii >= 1; ii--) { System.Diagnostics.StackFrame t_stackframe = new System.Diagnostics.StackFrame(ii); if (t_stackframe != null) { if (t_stackframe.GetMethod() != null) { t_stringbuilder.Append(t_stackframe.GetMethod().ReflectedType.FullName); t_stringbuilder.Append(" : "); t_stringbuilder.Append(t_stackframe.GetMethod().Name); t_stringbuilder.Append("\n"); } } } t_this.debug = t_stringbuilder.ToString(); }catch (System.Exception t_exception) { Tool.DebugReThrow(t_exception); } } #endif //表示フラグ。 t_this.visible = true; //削除フラグ。 t_this.is_delete_request = false; Render2D.GetInstance().InputField2D_Regist(t_this); //描画プライオリティ。 t_this.drawpriority = a_drawpriority; //位置。 //t_this.pos; //パラメータ。 t_this.param.InitializeFromPool(); //削除管理。 if (a_deleter != null) { a_deleter.Regist(t_this); } } return(t_this); }
/// <inheritdoc /> public override void Draw() { base.Draw(); var style = Style.Current; if (_window.Asset == null || !_window.Asset.IsLoaded) { Render2D.DrawText(style.FontLarge, "Loading...", new Rectangle(Float2.Zero, Size), style.ForegroundDisabled, TextAlignment.Center, TextAlignment.Center); } }
/// <inheritdoc /> public override void Draw() { base.Draw(); var style = Style.Current; var rect = new Rectangle(Vector2.Zero, Size); Render2D.PushClip(rect); Render2D.DrawText(style.FontMedium, Name, rect, Color.White, TextAlignment.Center, TextAlignment.Center, TextWrapping.WrapChars); Render2D.PopClip(); }
/// <inheritdoc /> public void Draw(Rectangle rect, Color color) { if (Filter == BrushFilter.Point) { Render2D.DrawSpritePoint(Sprite, rect, color); } else { Render2D.DrawSprite(Sprite, rect, color); } }
/// <inheritdoc /> public void Draw(Rectangle rect, Color color) { if (Filter == BrushFilter.Point) { Render2D.DrawTexturePoint(Texture?.Texture, rect, color); } else { Render2D.DrawTexture(Texture, rect, color); } }
public override void RenderSceme() { if (MapCamera == null) { return; } GL.DepthFunc(DepthFunction.Lequal); var cam = MapCamera.cameraData; foreach (var kcl in ParentEditor.CollisionObjects) { kcl.Renderer.Draw(Camera.ModelViewMatrix); } //Draw mini map and bind texture var angle = GetAngle(); var scaleX = cam.PositionX - cam.TargetX; var scaleY = cam.PositionZ - cam.TargetZ; GL.PushMatrix(); GL.Rotate(angle + -90, Vector3.UnitZ); GL.Enable(EnableCap.Texture2D); GL.DepthFunc(DepthFunction.Always); if (MapCameraTexture != null) { if (MapCameraTexture.RenderableTex == null || !MapCameraTexture.RenderableTex.GLInitialized) { MapCameraTexture.LoadOpenGLTexture(); } MapCameraTexture.RenderableTex?.Bind(); } Render2D.DrawRectangle(cam.BoundingWidth, cam.BoundingHeight, Color.FromArgb(CameraMapTransparency, Color.White), false); GL.PopMatrix(); GL.DepthFunc(DepthFunction.Lequal); GL.BindTexture(TextureTarget.Texture2D, 0); GL.Disable(EnableCap.Texture2D); GL.Disable(EnableCap.DepthTest); Render2D.DrawRectangle(cam.BoundingWidth, cam.BoundingHeight, Color.Red, true); GL.Enable(EnableCap.DepthTest); foreach (var obj in CameraPoints) { obj.Draw(); } }
/// <inheritdoc /> public override void Draw() { base.Draw(); var style = Style.Current; if (_window.Asset == null || !_window.Asset.IsLoaded) { Render2D.DrawText(style.FontLarge, "Loading...", new Rectangle(Vector2.Zero, Size), Color.White, TextAlignment.Center, TextAlignment.Center); } }
/// <inheritdoc /> public override void Draw() { // Draw background var style = Style.Current; var bounds = new Rectangle(Vector2.Zero, Size); Render2D.FillRectangle(bounds, style.Background); Render2D.DrawRectangle(bounds, Color.Lerp(style.BackgroundSelected, style.Background, 0.6f)); base.Draw(); }
/// <inheritdoc /> public override void Draw() { base.Draw(); float strength = BlurStrength; if (strength > Mathf.Epsilon) { Render2D.DrawBlur(new Rectangle(Vector2.Zero, Size), strength); } }
/// <inheritdoc /> public override void Draw() { var style = Style.Current; var timeAxisHeaderOffset = -_timeline.MediaBackground.ViewOffset.Y; var moveColor = style.ProgressNormal; var thickness = 2.0f; var borderColor = _isMoving ? moveColor : (IsMouseOver && _canEdit ? Color.Yellow : style.BorderNormal); Render2D.FillRectangle(new Rectangle((Width - thickness) * 0.5f, timeAxisHeaderOffset, thickness, Height - timeAxisHeaderOffset), borderColor); }
/** [Fee.Deleter.OnDelete_CallBackInterface]削除。 * * スプライトリストからの解除リクエスト。 * */ public void OnDelete() { //非表示。 this.visible = false; //非表示設定。 this.param.SetTexture(null); //削除リクエスト。 this.is_delete_request = true; Render2D.GetInstance().GetSpriteList().delete_request_flag = true; }
/** 初期化。 */ public void Initialize() { //raw this.raw_gameobject = Fee.Instantiate.Instantiate.CreateUiText("Text", Fee.Render2D.Render2D.GetInstance().GetRootTransform()); this.raw_transform = this.raw_gameobject.GetComponent <UnityEngine.Transform>(); this.raw_text = this.raw_gameobject.GetComponent <UnityEngine.UI.Text>(); this.raw_recttransform = this.raw_gameobject.GetComponent <UnityEngine.RectTransform>(); this.raw_gameobject.SetActive(false); //共通マテリアルアイテム複製。 this.raw_custom_text_material_item = Render2D.GetInstance().GettMaterialItem(MaterialType.UiText).Duplicate(); }
/// <inheritdoc /> public override void Draw() { base.Draw(); var isMouseOver = IsMouseOver; var color = Gradient._data[Index].Value; var icons = Editor.Instance.Icons; var icon = icons.VisjectBoxClose; Render2D.DrawSprite(icon, new Rectangle(0.0f, 0.0f, 10.0f, 10.0f), isMouseOver ? Color.Gray : Color.Black); Render2D.DrawSprite(icon, new Rectangle(1.0f, 1.0f, 8.0f, 8.0f), color); }
/// <inheritdoc /> public override void Draw() { var style = Style.Current; // Background Render2D.FillRectangle(new Rectangle(Vector2.Zero, Size), Color.Lerp(style.BackgroundSelected, style.Background, 0.6f)); Render2D.FillRectangle(new Rectangle(1.1f, 1.1f, Width - 2, Height - 2), style.Background); // Tooltip text Render2D.DrawText(style.FontMedium, _currentText, GetClientArea(), Color.White, TextAlignment.Center, TextAlignment.Center); base.Draw(); }