• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

DevLog Bitmap Font editor for CX using CX

Regarding TTF font reading, I have attached the project I was playing with. You need the modified target for that too. I loads a TTF file and creates mojo2 compatible font files. Not the most convenient solution but it might give you a head start. You need to place the ttf font file inside the data folder in my example.
 

Attachments

  • TTFonts.zip
    3.8 KB · Views: 236
@MikeHart Like, like like, like!!!! (because i cant click the like button 5 times)
Thank you sooo much. Looks like i was close, just dint know how to reference std-write-image.h in GLFW (I also tried importing it in png.cxs)
Will this be made official at some point for Canvas?
 
Regarding TTF font reading, I have attached the project I was playing with. You need the modified target for that too. I loads a TTF file and creates mojo2 compatible font files. Not the most convenient solution but it might give you a head start. You need to place the ttf font file inside the data folder in my example.
You're too good!!! This is a game changer (or should I say APP changer?)

Thank you!!!
 
@MikeHart Like, like like, like!!!! (because i cant click the like button 5 times)
Thank you sooo much. Looks like i was close, just dint know how to reference std-write-image.h in GLFW (I also tried importing it in png.cxs)
Will this be made official at some point for Canvas?

Maybe canvas, maybe databuffer. idk.
 
brilliant... just did a quick test and it works perfectly.

I did panic to begin with as it errored. i just removed the old GLFW build folder and let CX rebuild it ;-)
 
@MikeHart Just to let you know its not compatible with OS module
Code:
import os
Code:
../main.cpp: In function 'String::CString<char> C_STR(const String&)':
../main.cpp:6149:30: error: redefinition of 'String::CString<char> C_STR(const String&)'
static String::CString<char> C_STR( const String &t ){ return t.ToCString<char>(); };
                              ^
../main.cpp:5485:30: note: 'String::CString<char> C_STR(const String&)' previously defined here
static String::CString<char> C_STR( const String &t ){
                              ^
Makefile:61: recipe for target 'build/Debug64/main.o' failed
mingw32-make: *** [build/Debug64/main.o] Error 1
I use os to CopyFile, but now I can save a PNG I dint need to copy the PNG file, so not a show stopper ;-)
 
Yup.

Change the top of png.cpp to this:
C++:
//static String::CString<char> C_STR( const String &t ){ return t.ToCString<char>(); };

#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"

and add this line to the top of png.cxs:
C++:
Import os

This way it works even with the unmodified target.
 
@MikeHart heres a weird one. If you savePNG of a Canvas of the game area, the image is correct, but if you savePNG of a canvas of a New Image() the png is upside down
 
If you savePNG of a Canvas of the game area, the image is correct, but if you savePNG of a canvas of a New Image() the png is upside down
Well I would say if FreeImage is in the mix somewhere it's to be expected. Data is stored with the bottom scan line starting at the top.
But I don't recall FreeImage being needed anywhere.
 
Well I would say if FreeImage is in the mix somewhere it's to be expected. Data is stored with the bottom scan line starting at the top.
But I don't recall FreeImage being needed anywhere.
Just strange that canvas linked to the default draw area saves the the right way up, but a canvas linked to an image saves upside down. Yet both canvases draw the same in CX. Itl be something simple somewhere. I have a little look at the canvas object and can't see anything that stands out
 
More WIP. please ignore icons and layout ;-)
 
Back
Top Bottom