Trying to Display Text on Screen

Posted By: MattyTheG

Trying to Display Text on Screen - 11/13/08 04:44

Hello, I'm trying to display a score on the screen and I can't figure out a way to display text. I tried using digits(x,y,etc...) like the help says but I keep getting syntax errors. I tried putting it into a PANEL* and copied the code right out of Lite-C Workshops and it didn't run either.

If anyone could help, that would be great.
Posted By: heinekenbottle

Re: Trying to Display Text on Screen - 11/13/08 04:53

Code:
PANEL* scorePan =
{
	digits(300,10,"Score %f",Arial#15,1,score);
	flags = VISIBLE;
}


copied and pasted straight from my script, so no reason why it won't work.

Just remember a few things, PANELs are pointers, thus the asterisk. There is an "=" after the panel name. I know I just spent a good 5 minutes wondering why my digit panel wasn't working only to find that asterisk was missing.
Posted By: MattyTheG

Re: Trying to Display Text on Screen - 11/13/08 05:04

Yea I have a code that is pretty much exactly like that but I copied and pasted yours just to be safe and I still can't build it.

Parameter unknown PANEL* bad keyword in {}
Parameter unknown digits bad keyword in {}
Posted By: heinekenbottle

Re: Trying to Display Text on Screen - 11/13/08 06:12

do you have acknex.h included in your script?
Posted By: nsksleeper

Re: Trying to Display Text on Screen - 11/13/08 15:15

check that:

go to DEBUG->Set corent to main
Posted By: MattyTheG

Re: Trying to Display Text on Screen - 11/13/08 17:24

Yes I have

#include <acknex.h>
#include <default.c>

as my header, I checked that right after I copied the code above to make sure I had the right includes.

Also changing the DEBUG-> set current to main didn't help any frown I tried running debug mode but it just gives me the same build error as above.

Thanks for trying though. I have been in and out of gamestudio for like 4 months and never once have I been able to successfully put text on the screen. Perhaps my acknex.h is damaged?
Posted By: Uhrwerk

Re: Trying to Display Text on Screen - 11/13/08 17:40

Make sure you saved your file as .c file and NOT as .wdl file.
Posted By: MattyTheG

Re: Trying to Display Text on Screen - 11/13/08 17:51

Hmm I tried that but then I just got a bunch of syntax errors for the physics engine and the wait function and event_entity.

Perhaps I have confused two syntaxes and unknowingly put them both into one file so some work as .wdl and others work in .c

Guess I will have to look into that more.
© 2024 lite-C Forums