Display a variable on the screen[resolved]
Posted: Mon Feb 01, 2021 9:27 am
Hello,
I am new to the forum that I have already been browsing for a few weeks, I thank the author of this bookstore (SGDK) who opened the doors to me to programming on Megadrive in C Language, as well as all the participants / members of this forums that enrich this section of the forum, it helps a lot.
So I come to ask for help / advice for something I want to check.
I would like to track the value of a variable of type "int / s16" ingame to realize that it takes the values I want during a collision.
First, I managed to do it using multiple loop if (value == v) {VDP_drawTextBG (plan, "value = v"), x, y}. but it's long and not very clean.
In fact VDP_drawTextBG (), takes a "const * char" as a parameter and as my variable is an s16 that's a problem, there is indeed a FIX16toStr () function which converts an s16 to char * in the string.h file.
Is there a way to convert s16 to const * char?
I am new to the forum that I have already been browsing for a few weeks, I thank the author of this bookstore (SGDK) who opened the doors to me to programming on Megadrive in C Language, as well as all the participants / members of this forums that enrich this section of the forum, it helps a lot.
So I come to ask for help / advice for something I want to check.
I would like to track the value of a variable of type "int / s16" ingame to realize that it takes the values I want during a collision.
First, I managed to do it using multiple loop if (value == v) {VDP_drawTextBG (plan, "value = v"), x, y}. but it's long and not very clean.
In fact VDP_drawTextBG (), takes a "const * char" as a parameter and as my variable is an s16 that's a problem, there is indeed a FIX16toStr () function which converts an s16 to char * in the string.h file.
Is there a way to convert s16 to const * char?