Compare commits
2 Commits
Prerelease
...
shaders_ag
Author | SHA1 | Date | |
---|---|---|---|
819539247e | |||
a1ca7ace77 |
@@ -72,6 +72,8 @@ vec4 DefaultInstanced() {
|
|||||||
return gl_ModelViewProjectionMatrix * vec4(world_pos, 0.0, 1.0);
|
return gl_ModelViewProjectionMatrix * vec4(world_pos, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include "shared.glsl"
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
GL_TEXTURE0_COORD = gl_MultiTexCoord0.xy;
|
GL_TEXTURE0_COORD = gl_MultiTexCoord0.xy;
|
||||||
GL_TEXTURE1_COORD = gl_MultiTexCoord1.xy;
|
GL_TEXTURE1_COORD = gl_MultiTexCoord1.xy;
|
||||||
|
@@ -385,8 +385,9 @@ namespace JGL::J2D {
|
|||||||
/// @param scale The value (in both axes) to scale the text by. Defaults to {1,1}.
|
/// @param scale The value (in both axes) to scale the text by. Defaults to {1,1}.
|
||||||
/// @param size The point-size at which to render the font out. Re-using the same point-size allows efficient glyph caching.
|
/// @param size The point-size at which to render the font out. Re-using the same point-size allows efficient glyph caching.
|
||||||
/// @param font The font to use for rendering. @see Font.
|
/// @param font The font to use for rendering. @see Font.
|
||||||
void DrawString(const Color4& color, const std::string& text, float x, float y, float scale, u32 size, const Font& font = Fonts::Jupiteroid);
|
void DrawString(const Color4& color, const std::string& text, float x, float y, u32 size, float scale = 1.f, const Font& font = Fonts::Jupiteroid);
|
||||||
|
|
||||||
|
void DrawString(const Color4& color, const std::string& text, const Vector2& pos, u32 size, float scale = 1.f, const Font& font = Fonts::Jupiteroid);
|
||||||
|
|
||||||
/// Draws an Arc (section of a circle) to the screen.
|
/// Draws an Arc (section of a circle) to the screen.
|
||||||
/// @param color A 3-or-4 channel color value. @see class Color3, class Color4
|
/// @param color A 3-or-4 channel color value. @see class Color3, class Color4
|
||||||
|
@@ -1519,3 +1519,8 @@ void J2D::DrawSprite(const TextureAtlas* texture_atlas, const AtlasRegion& atlas
|
|||||||
void J2D::DrawSprite(const TextureAtlas& texture_atlas, const AtlasRegion& atlas_region, const Vector2& position, float rad_rotation, const Vector2& origin, const Vector2& scale, const Color4& color) {
|
void J2D::DrawSprite(const TextureAtlas& texture_atlas, const AtlasRegion& atlas_region, const Vector2& position, float rad_rotation, const Vector2& origin, const Vector2& scale, const Color4& color) {
|
||||||
J2D::DrawSprite(&texture_atlas, atlas_region, position, rad_rotation, origin, scale, color);
|
J2D::DrawSprite(&texture_atlas, atlas_region, position, rad_rotation, origin, scale, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void J2D::DrawString(const Color4 &color, const std::string &text, const Vector2 &pos, u32 size, float scale,
|
||||||
|
const Font &font) {
|
||||||
|
DrawString(color, text, pos.x, pos.y, size, scale, font);
|
||||||
|
}
|
||||||
|
@@ -98,7 +98,7 @@ namespace JGL {
|
|||||||
return cachedFont;
|
return cachedFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
void J2D::DrawString(const Color4& color, const std::string& text, float x, float y, float scale, u32 size, const Font& font) {
|
void J2D::DrawString(const Color4& color, const std::string& text, float x, float y, u32 size, float scale, const Font& font) {
|
||||||
// Offset by height to render at "correct" location.
|
// Offset by height to render at "correct" location.
|
||||||
y += size;
|
y += size;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user