20.09.2020
+ Instance Drawing + Text and Font ~ Made "DrawBackground" forced Background for 2D - DrawEmpty
This commit is contained in:
parent
acccf5f0e7
commit
c4a0847567
29 changed files with 365 additions and 85 deletions
|
|
@ -1,23 +1,25 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using SM.Base;
|
||||
using SM2D;
|
||||
using SM2D.Drawing;
|
||||
using SM2D.Scene;
|
||||
using Font = SM.Base.Text.Font;
|
||||
using Vector2 = OpenTK.Vector2;
|
||||
|
||||
namespace SM_TEST
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static Scene scene;
|
||||
private static Font font;
|
||||
static void Main(string[] args)
|
||||
{
|
||||
font = new Font(@"C:\Windows\Fonts\Arial.ttf")
|
||||
{
|
||||
FontSize = 64
|
||||
};
|
||||
|
||||
GLWindow2D window = new GLWindow2D {Scaling = new Vector2(0, 1000)};
|
||||
window.SetScene(scene = new Scene());
|
||||
window.Load += WindowOnLoad;
|
||||
|
|
@ -26,13 +28,17 @@ namespace SM_TEST
|
|||
|
||||
private static void WindowOnLoad(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
scene.Objects.Add(new DrawTexture(new Bitmap("soldier_logo.png")));
|
||||
scene.Objects.Add(new DrawTexture(new Bitmap("soldier_logo.png"))
|
||||
{
|
||||
Transform = { Position = new Vector2(100), Rotation = 45},
|
||||
});
|
||||
scene.Background = new DrawBackground(Color4.Beige);
|
||||
scene.Objects.Add(new DrawText(font, "Testing...")
|
||||
{
|
||||
Transform = {Size = new Vector2(1), Position = new SM.Base.Types.Vector2(0, -400)},
|
||||
Color = Color4.Black
|
||||
});
|
||||
scene.Background.Color = Color4.Beige;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue