Refactor ResourceLoader, use only Texture2d in Renderer.
This commit is contained in:
@@ -11,7 +11,7 @@ namespace DaggerFramework
|
||||
protected override void OnStart()
|
||||
{
|
||||
var renderer = Layer.Scene.Renderer;
|
||||
_texId = renderer.LoadTexture(Texture.Path);
|
||||
_texId = renderer.LoadTexture(_texture);
|
||||
}
|
||||
|
||||
public override void OnDraw(ref Renderer renderer)
|
||||
|
||||
21
Source/Entities/Text2d.cs
Normal file
21
Source/Entities/Text2d.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using DaggerFramework.Rendering;
|
||||
using System.Drawing;
|
||||
|
||||
namespace DaggerFramework
|
||||
{
|
||||
public class Text2d : Drawable2d
|
||||
{
|
||||
public string Contents { get => _contents; set => _contents = value; }
|
||||
public int FontSize { get => _fontSize; set => _fontSize = value; }
|
||||
public Color FontColor { get => _fontColor; set => _fontColor = value; }
|
||||
|
||||
public override void OnDraw(ref Renderer renderer)
|
||||
{
|
||||
renderer.DrawDebugText(position, _contents, _fontSize, _fontColor);
|
||||
}
|
||||
|
||||
private string _contents = string.Empty;
|
||||
private int _fontSize = 16;
|
||||
private Color _fontColor = Color.White;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user