Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Help with PRINT command in 2D

Author
Message
sgalland
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: United States
Posted: 24th Nov 2002 10:02
Hello, and thanks to all of you that helped me complete the basics of my ping pong game. I now have a functional game, just have to put the final elements into it. My question this time is how in the world do you get text to appear on screen, I use the PRINT command and I see nothing. Also how do you change the text color? I used the ink command and it crashed the game (after I retrieved the value from RGB function). So I am kind of lost on that.

Thanks,
Sean
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 24th Nov 2002 11:33
you have to set the cursor or the text will just fly down the screen put this

set cursor 0,0
print "level 1"

to change the ink

ink rgb(255,0,0),1

l8er

----- dark coder -----
Bitmap
21
Years of Service
User Offline
Joined: 20th Oct 2002
Location: Latvia
Posted: 24th Nov 2002 12:22
I suggest you use TEXT instead of PRINT. it's far better (and you can change the font too if using TEXT)

thy boss
sgalland
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: United States
Posted: 24th Nov 2002 17:01
Whenever I use any text output commands they do not show on screen at all, I am wondering why I dont see text what so ever...
actarus
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: 32 Light Years away
Posted: 24th Nov 2002 18:02
Are there any other members than the RGT ones in here? lol

-I am wondering why I dont see text what so ever...

That's because you don't paste it in the Do-loop and you probably cleared the screen(cls) after it...

I agree Print commands sux because of set cursor.

sgalland
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: United States
Posted: 24th Nov 2002 18:12
Here is my do-loop, I still don't see why it wont work:

sgalland
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: United States
Posted: 24th Nov 2002 18:21
I was doing some testing and the problem seems to occur only when I load sprites to the screen, it wont let text appear at all, even when the area with the text is not occupied. But if I remove all sprites from the program and run it text works fine. Any recommendations for bypassing this problem?
actarus
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: 32 Light Years away
Posted: 24th Nov 2002 19:30
Check out the draw to front/back commands...I'm not a '2Der' sorry.

Bitmap
21
Years of Service
User Offline
Joined: 20th Oct 2002
Location: Latvia
Posted: 24th Nov 2002 19:36
sgalland, are you using DBP?

anyway, I added a sprite to your code and removed the subroutines... it works ok



thy boss
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 24th Nov 2002 20:44
Yes, bits right. You must make the text a sprite to make it appear on a screen. Since sprites refresh every time the screen refreshs, the text value will always be shown. I posted somewhere on here how to make text a sprite, since I have to use it with my 3d RPG battle system.
RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 24th Nov 2002 20:46
Heres that snippet:



Hope that helps ya- if your using numbers, just say so and Ill post up my number sprite maker, using arrays.

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com
sgalland
21
Years of Service
User Offline
Joined: 18th Nov 2002
Location: United States
Posted: 25th Nov 2002 07:33
I wish I had DB Pro, I am about to program my own library of functions to overcome DB 1.13 problems and make it compatible with DB Pro lol. In my dreams maybe....
TheCyborg
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 25th Nov 2002 10:22
Why does you guys always use commands like:
ink 999999999999999999999999,255

Anyways there are only 16776705 colors in 32bit...
Everytime you input a color higher than that number, it will just start over. Writing 16776707 will be the exact same thing as writing 2.

BTW... I just use the RGB(r,g,b) command to get a little more accuracy.

TheCyborg Development.
http://TheCyborg.Amok.dk
The Ultimate Source To DarkBASIC Programming.

Login to post a reply

Server time is: 2024-04-16 20:57:20
Your offset time is: 2024-04-16 20:57:20