Bitmap font system works.
This commit is contained in:
@@ -24,6 +24,7 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
|
||||
private BitmapFont font;
|
||||
private Texture logoTexture, fillerTexture;
|
||||
private RectangleMesh logo, textureTester, untextured;
|
||||
private string lastPressed;
|
||||
|
||||
public WindowContext CurrentWindow { get { return window;}}
|
||||
|
||||
@@ -78,6 +79,7 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
|
||||
untextured.Y = - 0.15f;
|
||||
|
||||
font = new BitmapFont("Resources/Playground/earwig_factory_rg.ttf");
|
||||
font.PixelHeight = 128;
|
||||
}
|
||||
|
||||
public void Render(double delta)
|
||||
@@ -86,8 +88,8 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
|
||||
renderer.Draw(logo);
|
||||
renderer.Draw(textureTester);
|
||||
renderer.Draw(untextured);
|
||||
font.Draw(renderer, delta, 0.25f, -0.25f, "1234", Color.White);
|
||||
font.Draw(renderer, delta, 0.25f, -0.35f, "abcd", Color.White);
|
||||
font.Draw(renderer, 0.25f, -0.35f, "ABCDEFHIJKLMNOPQRSTUVWXYZ1234567890", Color.White);
|
||||
renderer.Draw(new RectangleMesh(new RectangleF(-1, -1, 0.5f, 0.5f), new RectangleF(0, 1, 1, -1), font.GetTextureBacking(0), Color.White));
|
||||
renderer.End();
|
||||
}
|
||||
|
||||
@@ -106,5 +108,9 @@ namespace SlatedGameToolkit.Tools.Utilities.Playground
|
||||
camera.MoveTo += new Vector2((0.25f) * (float) timeStep, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void KeyPressed(SDL.SDL_Keycode keycode, bool pressed) {
|
||||
if (pressed) lastPressed = SDL.SDL_GetKeyName(keycode);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user