04.10.2020
+ render pipeline system for more control about the renderering. + Log system + Framebuffer system ~ Default shader was moved to pipelines.
This commit is contained in:
parent
97e638d9d9
commit
820d6ce700
34 changed files with 660 additions and 106 deletions
|
|
@ -15,6 +15,7 @@ namespace SM2D.Drawing
|
|||
public static float MasterScale = .25f;
|
||||
|
||||
public float Scale = 1;
|
||||
public bool ManualSize = false;
|
||||
public Texture Texture
|
||||
{
|
||||
get => (Texture) _material.Texture;
|
||||
|
|
@ -28,16 +29,19 @@ namespace SM2D.Drawing
|
|||
public DrawTexture(Bitmap map) : this(map, Color4.White)
|
||||
{ }
|
||||
|
||||
public DrawTexture(Bitmap map, Color4 color)
|
||||
public DrawTexture(Bitmap map, Color4 color) : this((Texture)map, color)
|
||||
{ }
|
||||
|
||||
public DrawTexture(Texture texture, Color4 color)
|
||||
{
|
||||
_material.Texture = new Texture(map);
|
||||
_material.Texture = texture;
|
||||
_material.Tint = color;
|
||||
}
|
||||
|
||||
public override void Draw(DrawContext context)
|
||||
protected override void DrawContext(ref DrawContext context)
|
||||
{
|
||||
Transform.Size = new CVector2(Texture.Map.Width * MasterScale * Scale, Texture.Map.Height * MasterScale * Scale);
|
||||
base.Draw(context);
|
||||
if (!ManualSize) Transform.Size = new CVector2(Texture.Map.Width * MasterScale * Scale, Texture.Map.Height * MasterScale * Scale);
|
||||
base.DrawContext(ref context);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue