mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-03 18:47:10 +02:00
* Attempted Clyde cleanup, didn't get far. * Add negation operator to Vector2i. * Add RenderOrder to ISpriteComponent. * Post process shaders. Adds "post process" shaders to sprite component. These are executed on the WHOLE sprite component (every layer) in one draw. This is necessary to implement functional outlines.
51 lines
1.2 KiB
C#
51 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Robust.Client.Graphics.Drawing;
|
|
using Robust.Client.Interfaces.GameObjects.Components;
|
|
using Robust.Client.Interfaces.Graphics;
|
|
using Robust.Shared.Log;
|
|
using Robust.Shared.Maths;
|
|
|
|
namespace Robust.Client.UserInterface.Controls
|
|
{
|
|
public class SpriteView : Control
|
|
{
|
|
public ISpriteComponent Sprite { get; set; }
|
|
|
|
public SpriteView()
|
|
{
|
|
}
|
|
|
|
public SpriteView(string name) : base(name)
|
|
{
|
|
}
|
|
|
|
protected override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
RectClipContent = true;
|
|
}
|
|
|
|
protected override Vector2 CalculateMinimumSize()
|
|
{
|
|
// TODO: make this not hardcoded.
|
|
// It'll break on larger things.
|
|
return (32, 32);
|
|
}
|
|
|
|
internal override void DrawInternal(IRenderHandle renderHandle)
|
|
{
|
|
if (Sprite == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
renderHandle.DrawEntity(Sprite.Owner, GlobalPixelPosition + PixelSize / 2);
|
|
}
|
|
}
|
|
}
|