Skip to content

Commit

Permalink
Verkleedfeest2
Browse files Browse the repository at this point in the history
  • Loading branch information
RG committed Feb 25, 2020
1 parent ce46061 commit bbf882e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ Text rendering in Metal
Hack of https://metalbyexample.com/rendering-text-in-metal-with-signed-distance-fields/ for macOS.

Pure Cocao (no Mac Catalyst)

![alt text](verkleedfeest2.png "Verkleedfeest")
5 changes: 3 additions & 2 deletions TextRendering/MBERenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ -(nonnull instancetype)initWithMetalKitView:(nonnull MTKView *)view;
[self buildResources];

// NOTE: the trick is to use a huge font size and scale it down: looks much better.
_textScale = 1.0;//1.0;

_textScale = 1.0;
_textTranslation = CGPointMake(0, 0);


Expand Down Expand Up @@ -615,7 +616,7 @@ - (void)drawInMTKView:(nonnull MTKView *)view

// Print FPS onscreen
//NSString *string1 = [NSString stringWithFormat:@"A string: %@, a float: %1.2f", @"string", 31415.9265];
NSString *str = [NSString stringWithFormat:@"Frame: %i\nFPS: %.1f\nFont: %@\n\n%@", frame, fps, MBEFontName, str3];
NSString *str = [NSString stringWithFormat:@"Frame: %i\nFPS: %.1f\nFont: %@\n\n%@", frame, fps, MBEFontName, str2];
[self buildTextMesh:str];


Expand Down
Binary file added verkleedfeest2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bbf882e

Please sign in to comment.