Forum Replies Created
-
AuthorPosts
-
No problemo, let me know if there are any issues with the implementation. I also never actually realized how widely recognized the .fnt format is either…
Still got some weirdness at screen edges with that
The ‘official’ version is likely to be about the same!
Can you post a little demo-ette of the weirdness?
Just added support for the .fnt bitmap font formats and pushed the changes to the develop branch.
.fnt does seem to be the popular format for bitmap fonts so I’ve added this (the simple text format only) and called it ‘AngelFont’ as I believe it originated at the ‘angel code’ site? Please correct me if I’m wrong here.
I’ve also added experimental kerning support but this probably wont work quite right in mojox just yet as it makes it trickier to split text into chunks eg: for syntax highlighting.
Note that the bitmap loaders pick the correct shader to use based on image format. Images should either be 8 bit greyscale/alpha or 32 bit rgba.
Here’s the new banana showing how all the font types are used. In addition, Font.Load() will pick the right loader for you from filetype extension. Except for ImageFont, ‘coz it has lots parameters:
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566#remgnsh-bitmap font from opengameart.org:https://opengameart.org/content/bitmap-font-0#endNamespace myapp#Import "<std>"#Import "<mojo>"'simple image font#Import "gnsh-bitmapfont-colour1.png"'monochrome angel font#Import "testfont.fnt"#Import "testfont_0.png"'fullcolor angel font#Import "coolfont.fnt"#Import "coolfont.png"Using std..Using mojo..Class MyWindow Extends WindowMethod New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=Null )Super.New( title,width,height,flags )'Example of loading a ttf font directly' Style.Font=FreeTypeFont.Load( "asset::fonts/DejaVuSans.ttf",32 )'Example of loading a simple image font where chars are 15x36' Style.Font=ImageFont.Load( "asset::gnsh-bitmapfont-colour1.png",15,36 )'Example of loading a monochrome angel font' Style.Font=AngelFont.Load( "asset::testfont.fnt" )'Example of loading a fullcolor angel fontStyle.Font=AngelFont.Load( "asset::coolfont.fnt" )ClearColor=Color.Blue 'so we can see nice drop shadow.EndMethod OnRender( canvas:Canvas ) OverrideApp.RequestRender()canvas.DrawText( "The Quick Brown Fox Jumps Over The Lazy Dog",0,0 )EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndOoerrr, bmGlyph looks nice, shame it’s macos only. I have only been using a rather more limited windows one…
I will try and sort out the kerning everywhere too.
Is this useful for coloful fonts? Seems to be a ttf->bitmap font convertor system…
I have simple image based fixed width/height fonts going, is there some kind of file format for bitmap fonts I should also support?
Yes, a Spanish site would be great!
Logos etc can be found at the download link above:
http://monkeycoder.co.nz/monkey2-logo-and-resources/
As for syntax highlighing, this site uses the crayon plugin which has ‘monkey’ as one of its supported languages so we just use that!
No, there is no built-in support for ‘grid’ based bitmap fonts, but it wouldn’t be hard to add, it’ll put it on the todo list.
Why is the executable so big?
Monkey2 apps are effectively c++ apps, and c++ apps tend to be on the large side.
I’m open to ideas for reducing exe size (although I’ve probably tried a lot more than people realize along the way) but please note it’s not a high priority for me as I’m OK with current exe sizes right now, ie: I’m willing to live with a little extra bloat in exchange for the added flexilibity having c++ underlying everything offers.
That said, the zip above appears to have been built using mingw which produces larger than normal exes IMO, rebuilding with msvc halves the size of the exe. When I rebuild ted2 for release, I ‘rebuild’ all with msvc x86 for smallest size + max compatibility, although I doubt anyone’s actually using monkey2 on 32 bit windows?
Also, the ‘angle’ dlls etc in there aren’t actually necessary as mojo3d uses pure opengl on desktop by default.
The rest of the zip’s file size is mainly massively cool textures!
Hi, I will email you a default project template with all the blank assets needed.
Thanks very much, this will save me a ton of work. I added a ‘Launch Image’ storyboard and some stuff started magically working but there’s still weird stuff going on possibly due to missing icons/files etc.
Ok, googling around abit more and it looks like I need to create a ‘launch screen’ storyboard – will attempt this tomorrow as it’s getting late but can anyone confirm this?
This will apparently make the app ‘optimized for iphone 6’ etc while will hopefully disable the display zoom stuff so it uses up full 750, 1334 res.
I really have no idea what I’m doing here though…!
Woohoo, will update the emsdk to include python27.dll and mserver.exe later today. Thanks for the help everyone, this is most promising…!
python27.dll could not be found
Ok, it appears this is ‘missing’ from the latest python installers. It doesn’t appear to be included in emscripten’s version of python either.
It looks like python was only working on my machine because I had python27.dll in my windows/system32 dir. If I delete this file, I get the python27.dll not found error too, so it looks like python was only working at all thanks to an earlier installation.
I’ve zipped and uploaded python27.dll here:
http://monkeycoder.co.nz/get-file/?file=python27.zip
Note you’ll have to copy and paste the link, for some reason WP can’t link to it properly.
Unzip this into your monkey2 devtools\emsdk-1.37.35_64bit\python\2.7.5.3_64bit folder and try again – this fixes the python issue for me so here’s hoping…it could be good you found this!
Have you ever installed python before? emscripten?
Not 100% sure if it’s windows 10 update related but here’s the emscripten thread I started re: problems with your (well, the official!) installer:
https://groups.google.com/forum/#!topic/emscripten-discuss/yNv7y1cFI20
As far as I can tell, 2 out of 3 emscripten installs (windows, macos) are currently broken/uninstallable.
Another guy is having the same python problem too:
https://groups.google.com/forum/#!topic/emscripten-discuss/4BTW7rdyXdw
This problem only occurs when emsdk install tries to download one particular file though, and since my SDK includes all files normally downloaded by emsdk install (I hope) it’s not an issue.
I was also having problems with git lately that required installing some mysterious .NET security thing – man, hackers must love all this craptacular software! But I was thinking this may be related to the python problem, ie: windows 10 update is handling SSL slightly differently or something – dunno really, not my thing, really really wish I didn’t have to know anything about it!
What did you do to get it working?
-
AuthorPosts